- MongoDB High Availability
- Afshin Mehrabani
- 239字
- 2021-04-02 10:05:06
Failover in replica set
In MongoDB, we have a feature that enables clustering for a database. This feature is called a replica set. In further chapters, we will introduce and review it in detail. However, for this chapter, a brief introduction to this feature is enough.
Note
A replica set in MongoDB is a group of mongod
processes that maintain the same dataset. Replica sets provide redundancy and high availability and are the basis for all production deployments. For more information, please visit http://docs.mongodb.org/manual/replication/.
In replica sets, when the primary node becomes unavailable, the replica set conducts an election process to choose a new primary member from secondaries. This change might take about 10 to 60 seconds. However, it varies between servers and depends on the replica set settings, numbers of nodes, and server capacity.
While performing the election process, the replica set becomes unavailable for write operations. So, in this situation, operations are limited and you cannot perform write operations until the primary node is available.
There are several ways to address these kinds of issues, such as providing an internal loop statement and trying to insert data until the primary node becomes available. On the other hand, using a queue system and putting all the write operations in it and then applying them when the primary node becomes available is another solution.
In further chapters, we will talk about the high availability of replica sets in detail.
- 中文版CorelDRAW 2022基礎(chǔ)教程
- 擁抱開源(第2版)
- 中文版Premiere影視編輯課堂實錄
- 數(shù)字孿生體:第四次工業(yè)革命的通用目的技術(shù)
- AutoCAD 2014 中文版從入門到精通
- Photoshop+Illustrator商業(yè)廣告設(shè)計從入門到精通(第2版)
- UI功夫:PC和APP界面設(shè)計全流程圖解
- PowerPoint 2013從新手到高手(超值版)
- KNIME視覺化數(shù)據(jù)分析
- Expert Python Programming
- 管家婆軟件實戰(zhàn)操作教程(輝煌版)
- 剪映短視頻制作從入門到精通(手機(jī)版+電腦版)
- Midjourney AI生圖與修圖從入門到精通
- 中文版Photoshop CS6建筑效果圖后期處理技法
- Practical Plone 3: A Beginner's Guide to Building Powerful Websites