Skip to Content
MongoDB权威指南(第3版)
book

MongoDB权威指南(第3版)

by Shannon Bradshaw, Eoin Brazil, Kristina Chodorow
November 2021
Intermediate to advanced
410 pages
12h 1m
Chinese
Posts & Telecom Press
Content preview from MongoDB权威指南(第3版)
4
1
向扩展通常是阻力最小的途径,但它也有缺点:大型机器一般非常昂贵,而且在最终达到
物理极限时,就无法再升级到更高的配置了。另一种方式是横向扩展:如果想增加存储空
间或增加读写操作的吞吐量,那么可以购买额外的服务器,并将它们添加到集群中。这既
便宜又便于扩展,但管理
1000
台机器比管理
1
台机器困难得多。
MongoDB
的设计采用了横向扩展
。面向文档的数据模型使跨多台服务器拆分数据更加容
易。
MongoDB
会自动平衡跨集群的数据和负载
,自动重新分配文档,并将读写操作路由
到正确的机器上,如图
1-1
所示。
应用程序
驱动程序
应用程序
驱动程序
mongos
(路由节点)
应用程序
分片节点 分片节点
数据 数据
驱动程序
配置服务器
配置服务器
配置服务器
1-1:使用分片将 MongoDB 横向扩展至多台服务器
MongoDB
集群的拓扑结构,或者说其连接的是一个集群还是单个节点,对应用程序来说
都是透明的。这使得开发人员能够专注于应用程序的开发,而无须考虑扩展问题。同样,
如果需要扩展现有部署的拓扑结构以支持更多负载,那么也无须更改应用程序的逻辑。
1.3
 功能丰富
MongoDB
是通用型数据库,除了创建、读取、更新和删除数据外,它还提供了数据库管
理系统的常见功能和许多其他独特的功能,举例如下。
索引
MongoDB
支持通用的二级索引
,并提供唯一索引、复合索引、地理空间索引及全文索
引功能。此外,它还支持在不同层次结构(如嵌套文档和数组)上建立二级索引,让开
发人员能够以最适合应用程序的方式充分利用其建模能力。
聚合
MongoDB ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9787115576538