MongoDB ReplicaSet for Production Deployment with two Sites

57 Views Asked by At

I have couple of questions with respect to Mongo DB production deployment.

  1. Is using Mongo DB Replica-Set a right approach for a two site production deployment?

  2. Can i achieve high availability with Mongo DB on a two site production deployment. I feel we need >= 3 data centers to achieve high availability.

Thanks

1

There are 1 best solutions below

0
On

Yes a replicaset is a good idea for a production deployment.

A 2 site / AZ replicaset could provide high availability, but replicasets need configured with an odd number of nodes (3,5,7 etc), so one site would always have a majority (i.e. one site would contain more nodes than the other). If the site with the majority went down then the database would be unavailable.

Configuring the RS across 3 AZ would mean a better split of nodes and no one AZ would contain a majority. This means 1 AZ could go down but the database would remain up.