Docs HomeMongoDB Manual

Introduction to MongoDBMongoDB简介

Document Database文档数据库

A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB中的记录是一个文档,它是一个由字段和值对组成的数据结构。MongoDB documents are similar to JSON objects. MongoDB文档类似于JSON对象。The values of fields may include other documents, arrays, and arrays of documents.字段的值可以包括其他文档、数组和文档数组。

A MongoDB document.

The advantages of using documents are:使用文档的优势在于:

  • Documents correspond to native data types in many programming languages.文档对应于许多编程语言中的本机数据类型。
  • Embedded documents and arrays reduce need for expensive joins.嵌入式文档和数组减少了对昂贵联接的需求。
  • Dynamic schema supports fluent polymorphism.动态模式支持流畅多态性。

Collections/Views/On-Demand Materialized Views集合/视图/按需实体化视图

MongoDB stores documents in collections. Collections are analogous to tables in relational databases.MongoDB将文档存储在集合中。集合类似于关系数据库中的表。

In addition to collections, MongoDB supports:除了集合之外,MongoDB还支持:

Key Features主要功能

High Performance高性能

MongoDB provides high performance data persistence. In particular,MongoDB提供了高性能的数据持久性。特别地,

  • Support for embedded data models reduces I/O activity on database system.对嵌入式数据模型的支持减少了数据库系统上的I/O活动。
  • Indexes support faster queries and can include keys from embedded documents and arrays.索引支持更快的查询,并且可以包括来自嵌入文档和数组的键。

Query API查询API

The MongoDB Query API supports read and write operations (CRUD) as well as:MongoDB Query API支持读写操作(CRUD)以及:

High Availability高可用性

MongoDB's replication facility, called replica set, provides:MongoDB的复制工具,称为副本集,提供:

  • 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.副本集是一组MongoDB服务器,它们维护相同的数据集,提供冗余并提高数据可用性。

Horizontal Scalability水平可扩展性

MongoDB provides horizontal scalability as part of its core functionality:MongoDB提供横向可扩展性作为其核心功能的一部分:

  • Sharding distributes data across a cluster of machines.分片将数据分布在一组机器上。
  • Starting in 3.4, MongoDB supports creating zones of data based on the shard key. 从3.4开始,MongoDB支持基于分片键创建数据区域In a balanced cluster, MongoDB directs reads and writes covered by a zone only to those shards inside the zone. 在一个平衡的集群中,MongoDB只将区域覆盖的读写定向到区域内的分片。See the Zones manual page for more information.有关详细信息,请参阅分区手册页面。

Support for Multiple Storage Engines支持多个存储引擎

MongoDB supports multiple storage engines:MongoDB支持多种存储引擎

In addition, MongoDB provides pluggable storage engine API that allows third parties to develop storage engines for MongoDB.此外,MongoDB提供了可插拔存储引擎API,允许第三方为MongoDB开发存储引擎。