0

We have plans to set up a web solution in 3 locations... fronted by a load balancer that will distribute based on the location of the client. So if the request for the web app is coming in from north america, we will route to the north american server / site. How can I get this type of a set up to work if the back end database is mongodb? From what I'm reading, you can't have multi-master replication where any of the 3 locations can write to their local database, and have it replicate to the other 2.

Can you point me in the right direction? thanks.

dot
  • 14,928
  • 41
  • 110
  • 218

1 Answers1

-1

This will probably not have the results you're looking for. I assume you have the front end web servers geographically located to improve performance but they will still need to go to Mongo for data - this means the Mongo boxes need to have all of the data locally. So the time for HTTP to get from the client to the webserver will be short but then, depending on which Mongo box has the data you need, you will have to travel across the network to read/write.

Some of this can be solved by caching or replicating all the data to each location but you still will run into problems writing. You can also have multiple writable instances but then you need to be aware that you will have eventual constistancy.

TheFiddlerWins
  • 860
  • 5
  • 19
  • the plan was to have all the data locally in each location. I wasn't planning on sharding. can you describe how i can get multiple writable instances? – dot Dec 20 '18 at 18:28
  • I don't think you can – TheFiddlerWins Dec 20 '18 at 18:55
  • oh ok. your answer seems to indicate i can when you say " You can also have multiple writable instances but then you need to be aware that you will have eventual constistancy." Or did I misunderstand? – dot Dec 20 '18 at 18:58