Replication

MongoDB supports asynchronous replication of data between servers for failover and redundancy. Only one server (in the set/shard) is active for writes (the primary, or master) at a given time. With a single active master at any point in time, strong consistency semantics are available. One can optionally send read operations to the slaves/secondaries when eventual consistency semantics are acceptable.

Which should I use?

  • if using <v1.6 : master/slave
  • if need automatic fail-over and recovery (easy administration): replica sets
  • if using --auth (security) or --slavedelay : for now, master/slave
  • if using sharding : either, but replica sets are best for clusters that are not small
  • if risk averse : master/slave (replica sets are new to v1.6.0)

Verifying propagation of writes with getlasterror

A client can block until a write operation has been replicated to N servers -- read more here .

Presentations


Labels

printreplicationinfo printreplicationinfo Delete
printslavereplicationinfo printslavereplicationinfo Delete
getreplicationinfo getreplicationinfo Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.

blog comments powered by Disqus