Does mongo guarantee data durability and integrity with replication?

Hi,

I plan to use MongoDB Enterprise Edition v5.0.x in a single cluster replica set mode across three data centers (with 5 nodes in total, 2 in DC1, 2 in DC2 and 1 in DC3) for one of the application we are working on in my company (with eventual consistency, of course). However, I have heard concerns about mongodb not able to guarantee the durability and data integrity across all nodes within the replica set. Essentially, the area of concern is that if the application writes ‘n’ number of records to primary, there is no guarantee that the secondary nodes (especially in other DCs) will also end up having ‘n’ records. There may be a small delta records missing in the secondary (especially those in the other DCs). And hence the use of Mongo is not recommended unless there is any official documentation which says that data replication is guarantee across all nodes in the replica set.

Is there any such documentation available which specifically mentions or talks about guarantee in data durability and integrity across replica set within a single cluster? That will help me to present my case appropriately for using mongodb.

Hello @Adi_Min ,

Welcome to The MongoDB Community Forums! :wave:

MongoDB provides strong guarantees for data durability and integrity across replica sets, even in multi-data center deployments. The MongoDB documentation provides detailed information about how replication works and what guarantees it provides. Here are some relevant sections of the documentation:

In particular, MongoDB uses a primary-secondary replication model in which all writes must be acknowledged by a majority of the replica set members before they are considered committed. This ensures that data is replicated across a majority of the nodes in the replica set, which provides both data durability and consistency guarantees. Additionally, MongoDB provides configurable write concerns that allow you to control the level of durability and consistency you require for your application.

Regarding multi-data center deployments, MongoDB provides several deployment architectures that allow you to replicate data across multiple data centers while maintaining strong consistency and durability guarantees.

MongoDB Enterprise is part of the Enterprise Advanced subscription and is a commercial product that requires a license to operate. If you’re in the process of evaluating MongoDB Enterprise and you have specific questions regarding operational concerns, please DM me and I can connect you to the relevant people that can also help answer any questions you have.

Regards,
Tarun

1 Like

Any production-ready replication technology in a distributed data system has to ensure that.

But you know, we are humans, and we write code. and the code can have bugs. And it’s difficult to ship such a big product bug free. That’s it.