0

I'm working on a project where I need to deploy two MongoDB databases in different geographical locations. I want both databases to work independently, allowing reads and writes on both sides. However, I also need a mechanism to ensure that changes made in one database are synced to the other in a master-master-like fashion.

What strategies or technologies can I employ to achieve this master-master replication setup in MongoDB? Are there any best practices or specific considerations for handling synchronization across different locations? I'd appreciate any insights, examples, or recommended tools to implement a robust and reliable solution for keeping two MongoDB databases in sync.

I've explored Active-passive, but it doesn't entirely fulfill my requirement for a master-master setup with databases deployed in different geographical locations. While primary-secondary replication is excellent for high availability and fault tolerance, it doesn't support simultaneous writes to both databases, making it fall short for my specific use case.

3
  • "allowing reads and writes on both sides" - simple answer: not possible with MongoDB. Only solution would be a sharded cluster where you put mongos in each geographical location. However, for the data bearing nodes you can have only one PRIMARY and only the PRIMARY permits write operations. Or you can deploy synchronization by yourself on application level. Commented Jan 30, 2024 at 13:16
  • perhaps cassandra may cover this use case: bikas-katwal.medium.com/… Commented Jan 30, 2024 at 19:08
  • No, mongodb does not provide master-master replication. Look at Couchbase, it is document oriented model as mongodb, but with master-master replication. Commented Feb 27, 2024 at 15:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.