MongoDB是一種強大、靈活、可拓展的數據存儲方式。它擴展了關係型數據庫等,吧啦吧啦一大堆廢話,對於一門新的語言或者技術,瞭解技術背景是一方面,動手實練也是必不可少的。這裏我打算髮一些MongoDB從入門到項目應用的文章,也方便做些技術預言。將涉獵到MongoDB基礎應用入門以及分佈式部署等等方面。
一:從mongodb.org官網入手,瞭解MongoDB
Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents.
A MongoDB document.
The advantages of using documents are:
- Documents (i.e. objects) correspond to native data types in many programming language.
- Embedded documents and arrays reduce need for expensive joins.
- Dynamic schema supports fluent polymorphism.
Key Features
High Performance
MongoDB provides high performance data persistence. In particular,
- Support for embedded data models reduces I/O activity on database system.
- Indexes support faster queries and can include keys from embedded documents and arrays.
High Availability
To provide high availability, MongoDB’s replication facility, called replica sets, provide:
- automatic failover.
- data redundancy.
A replica set is a group of MongoDB servers that maintain the same data set, providing redundancy and increasing data availability.
Automatic Scaling
MongoDB provides horizontal scalability as part of its core functionality.
- Automatic sharding distributes data across a cluster of machines.
- Replica sets can provide eventually-consistent reads for low-latency high throughput deployments.