0

Is it possible to create two 3 node replica sets with mongodb but have one replica set be the master and the other be the slave?

What I want is to have one replica set on the east coast, and one on the west coast. I'll only be writing to the west coast cluster. I want the east coast cluster to be the "slave" and replicate from the west coast.

The reason I want this is so that I can deploy my API on the west and on the east. The west coast application will connect to the west coast mongodb replica set. The east coast application will connect to the east coast application. And the load balancer to the API will route users to the nearest API instance.

I know I can create master-slaves in mongodb, but then I won't have automatic failover.

I also know that I can create a replica set and put some of the nodes on the east and west and can do reads from individual nodes, but then I don't have redundancy. If the API is connecting to one of the nodes and that node fails, there's no automatic failover.

So basically what I want is a master slave configuration where the master and the slave are each replica sets.

Thanks!

Khon Lieu
  • 4,295
  • 7
  • 37
  • 39

0 Answers0