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版)
持久性
335
操作之前等待日志记录确实会造成性能损失。
在解决持久性问题时,必须仔细评估应用程序的需求,并权衡所选择的持久性设置对性能
的影响。
20.3
 使用读关注的集群级别持久性
MongoDB
中,读关注(
read concern
)允许对何时读取结果进行配置。这可以让客户端
在写操作被持久化之前就看到写入的结果。读关注可以与写关注一起使用,以控制对应用
程序的一致性和可用性的保证级别。不要将读关注与读偏好(
read
preference
)相混淆,后
者处理从何处读取数据的问题。具体来说,读偏好决定了副本集中承载数据的成员。默认
的读偏好是从主节点中读取。
读关注决定了正在读取的数据的一致性和隔离性。默认的
readConcern
local
,它所返
回的数据不保证已经被写入了大多数承载数据的副本集成员。这可能会导致数据在将来的
某个时刻被回滚。
majority
读关注只返回被大多数副本集成员确认的持久数据(不会被回
)。
MongoDB 3.4
中增加了
linearizable
读关注,它确保返回的数据反映了在读操作开
始之前已成功完成的经过大多数确认的写操作。在返回结果之前,它可能会等待那些正在
并发执行的写操作完成。
和写关注一样,在为应用程序选择合适的关注选项之前,需要权衡读关注对性能的影响,
以及它们提供的持久性和隔离性保证。
20.4
 使用写关注的事务持久性
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