MongoDB Active-Active Multiple Datacenters

125 views
Skip to first unread message

Jimmy Chen

unread,
Feb 22, 2017, 9:25:29 PM2/22/17
to mongodb-user
I am looking for a method to configure MongoDB servers across 2 different datacenters where they remain in an active-active configuration. Site A is the normal Production environment that customers access and all writes are sent here, but all data writes are also replicated to site B, which is the backup. Furthermore, site B should also be able to accept any writes and replicate that to site A. In the DR situation, and site A is gone, site B would have the complete data set and be switched to instantly (DNS only most likely) and nothing would need to be changed via the application.

I've done quite a bit of searching and I have yet found a solution. The closest I've found is sharded cluster, but that would require setting up multiple shards and each with replica-set and criss-cross where each replica-set is located between site A and B. This would also mean that regular writes to a shard with the primary Mongo instance located in the other datacenter to be traversing networks and be considerably slower.

Vahric Muhtaryan

unread,
Feb 23, 2017, 1:32:13 AM2/23/17
to mongodb-user

Michael Liu

unread,
Feb 24, 2017, 12:36:13 AM2/24/17
to mongodb-user
Hi Jimmy Chen ! 

There has similar requirements in out company (Alibaba. in China). we construct a data syncing pipeline between A and B(A and B just as your mentioned). like A <=> B. And the only thing we should take action on one data center is gone. is just switching the use request and net traffic to another one. Since they have the same mirror data.

In this scenario. A and B don't need to deploy as an ReplicaSet each other. That means no heartbeats and primary election between the long distance network....  
Reply all
Reply to author
Forward
0 new messages