Article

Why we need to use Odd number of nodes in MongoDB ReplicaSet

Topic: Corporate TrainingPublished October 5, 2017

Legacy signals

Legacy popularity: 1,282 legacy views

In MongoDB ReplicaSet, the voting is done by a majority of voting members. Imagine a Replica Set with three (voting) members. Let’s say that Node A is primary, and nodes B+C are secondaries. Node A goes down, so nodes B+C go to election. They still do form a majority (two out of three). The election is first decided by priority. If both Nodes B & C have the same priority, then the one who is most up to date in respect to the failed primary (oplog) wins. Let’s say it’s Node B. Once node A comes back alive, there is no new election. Node B remains the master, and C+A are now secondaries. On the other hand, if two nodes go down you don’t have a majority, so the replica set can’t accept updates (apply writes) anymore until at least one of the two failing servers becomes alive (and connected by the single surviving node) again. Imagine now a Replica Set with four (voting) members. Let’s say that Node A is primary, and nodes B+C+D are secondaries. Node A goes down, so nodes B+C+D go to election. They of course form majority (three out of four) However, if two nodes go down you don’t have a majority (two out of four), so the replica set is again at read-only mode. So that’s why an odd number is recommended; If you loose a single member in a 3 members replica set, it’s the same as loosing a single member in a 4 members replica set: you still gain quorum majority and a new primary can be elected (the RS can still elect a new master by majority). On the other hand, if you loose two members in a 3 members replica set or a 4 members replica set (or n/2 members of n-members replica set) – again – the impact is the same: No new leader can be voted by election. So, to make a long story short, there is no redundancy gain by having an even number of members in a replica set. Read More:https://kovidacademy.com/blog/need-use-odd-number-nodes-mongodb-replicaset/

Further reading

Further Reading

4 total

Article

The popularity of Togel Online has grown significantly in recent years as more players turn to digital platforms for convenience, security, and real-time access to lottery markets. Among the many platforms available today, Pestoto has gained attention as a trusted online togel site offering access to Macau markets along with reliable number prediction insights. For players who want a professional and secure environment to play togel, Pestoto provides a modern platform designe

March 15, 2026

Article

The growth of online gambling platforms has created an exciting digital space for entertainment and opportunities. However, with this expansion also comes the challenge of maintaining safe and reliable environments for players. One of the most critical threats to trust within these platforms is the problem of fraudulent activities, particularly the so-called “eat-and-run” cases where operators or users exploit loopholes to escape without fulfilling their obligations. To c

September 8, 2025

Article

Undertaking a renovation project can transform any property, making it more efficient, functional, or simply more visually appealing. However, older structures often hide unseen risks, with asbestos being one of the most dangerous. Conducting an asbestos survey prior to renovations not only ensures the health and safety of everyone involved but also guarantees that all legal requirements are met.rnProtecting Health and Well-BeingrnOne of the most significant benefits of an as

July 19, 2025

Article

Soccer is undeniably one of the most loved sports worldwide, with millions of fans passionate about following their favorite teams, players, and leagues. The growing international soccer culture has only increased the demand for accessible broadcasting options that allow fans to tune into matches without facing unnecessary barriers like expensive subscriptions. Being able to watch soccer for free, particularly overseas broadcasts, is a major draw for Overseas free soccer broa

May 27, 2025