MongoDB
MongoDB is a document database designed for ease of development and scaling.
MongoDB是一种文档数据库,设计用于简化开发和扩展。
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.
MongoDB中的记录是一个文档,它是一个由字段和值对组成的数据结构。MongoDB文档类似于JSON对象。字段的值可以包括其他文档、数组和文档数组。
{
name: "yang", // filed: value
age: 26,
status: "A",
group: ["news", "sports"]
}
2
3
4
5
6
The advantages of using documents are:
- Documents (i.e. objects) correspond to native data types in many programming languages.
- Embedded documents and arrays reduce need for expensive joins.
- Dynamic schema supports fluent polymorphism.
使用文件的好处是:
- 文档(即对象)对应于许多编程语言中的本地数据类型。
- 嵌入的文档和数组减少了对昂贵连接的需求。
- 动态模式支持连贯多态。
MongoDB stores documents in collections.
MongoDB将文档存储在集合中。
Collections are analogous to tables in relational databases.
集合类似于关系数据库中的表。
--
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.
Rich Query Language MongoDB supports a rich query language to support read and write operations (CRUD) as well as:
Data Aggregation Text Search and Geospatial Queries. SEE ALSO
SQL to MongoDB Mapping Chart
SQL to Aggregation Mapping Chart Learn about the latest query language features with the MongoDB Query Language: What’s New presentation from MongoDB.live 2020. High Availability MongoDB’s replication facility, called replica set, provides:
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.
Horizontal Scalability
MongoDB provides horizontal scalability as part of its core functionality:
Sharding distributes data across a cluster of machines.
Starting in 3.4, MongoDB supports creating zones of data based on the shard key. In a balanced cluster, MongoDB directs reads and writes covered by a zone only to those shards inside the zone. See the Zones manual page for more information. Support for Multiple Storage Engines MongoDB supports multiple storage engines:
WiredTiger Storage Engine (including support for Encryption at Rest)
In-Memory Storage Engine.
In addition, MongoDB provides pluggable storage engine API that allows third parties to develop storage engines for MongoDB.
关键特性
高性能
MongoDB提供了高性能的数据持久性。特别是对嵌入式数据模型的支持减少了数据库系统上的I/O活动。
索引支持更快的查询,并且可以包含来自嵌入文档和数组的键。
丰富的查询语言
MongoDB支持丰富的查询语言,支持读写操作(CRUD),以及:
数据聚合
文本搜索和地理空间查询。
另请参阅
SQL到MongoDB的映射图
SQL到聚合映射图
了解MongoDB查询语言的最新查询语言特性:MongoDB的新表示。活2020年。
高可用性
MongoDB的复制设施,称为replica set,提供:
自动故障转移
数据冗余。
副本集是一组MongoDB服务器,它们维护相同的数据集,提供冗余并增加数据可用性。
水平可伸缩性
MongoDB提供了水平的可伸缩性作为其核心功能的一部分:
分片将数据分发到一个机器集群中。
从3.4开始,MongoDB支持基于shard key创建数据区域。在一个平衡的集群中,MongoDB只将一个区域覆盖的读和写定向到该区域内的那些碎片。有关更多信息,请参阅区域手册页。
支持多个存储引擎
MongoDB支持多种存储引擎:
WiredTiger存储引擎(包括支持静态加密)
内存存储引擎。 此外,MongoDB提供了可插拔的存储引擎API,允许第三方为MongoDB开发存储引擎。
Gitalking ...