Replica Sets & Zero Data Loss

70 views
Skip to first unread message

hacke...@gmail.com

unread,
Feb 23, 2016, 9:44:16 AM2/23/16
to mongodb-user
Hi All

I have a question around whether MongoDB replication can guarantee zero-data loss during a failure or disaster. Any help would be greatly appreciated.

Based on my current understanding of MongoDB, I believe the following architecture combined with j:true and w:majority writes will offer zero data loss in all failure scenarios (loss of a server, data centre, network partition):

DC1 - Primary
DC2 - Secondary
DC3 - Secondary

E.g. write operations will not return until they have been written to two replica set members, the use of a majority write concern protects against rollbacks.

I've read http://www.richardfawcett.net/2012/12/17/investigating-how-mongodbs-majority-write-concern-works and see that a primary can pull data from secondary servers in edge-case scenarios where an election occurs and the new primary does not have a write that one of the secondaries has.

However, I have also read MongoDB's Andrew Erlichson "Keeping Your Data Safe" presentation and on slide 4 it says with replication you will "Lose very little to zero data in a failure" (http://www.slideshare.net/mongodb/webinar-keeping-your-mongodb-data-safe). 

My question is whether the "very little" data loss comment refers to deployments that are not across 3 data centres or don't use majority replica safe writes? Or, are there data loss scenarios in the above configuration that I haven't considered.

Any help much appreciated

Thanks

Austin

Asya Kamsky

unread,
Feb 23, 2016, 3:01:35 PM2/23/16
to mongod...@googlegroups.com
The blog post is not describing an edge case - unless you explicitly disable chained replication, a secondary will replicate off of any member that's ahead of it - it allows replicating from another secondary in the same data center rather than say primary in another data center (i.e. It's better if only one of secondaries is pulling data across data centers).     

I haven't heard the webinar but it seems clear that losing data or not depends specifically on writeConcern you are using.   Use w:1 and you will likely lose some writes during failover. Use majority and you won't lose any *acknowledged* writes. 

Asya

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/de7fc9d6-3898-4751-a723-a7f531b323ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
Free MongoDB Monitoring - cloud.mongodb.com
Free Online Education - university.mongodb.com
Get Involved - mongodb.org/community
We're Hiring! - https://www.mongodb.com/careers
Reply all
Reply to author
Forward
0 new messages