4 ms·
If you’re fine with a single master that you write to and geographically distributed slaves for reading it’s not so difficult, you can use WAL streaming or log
by ThePhysicist 7y ago
If you’re fine with a single master that you write to and geographically distributed slaves for reading it’s not so difficult, you can use WAL streaming or log shipping to keep your slaves in sync with your master. You can use some additional tooling (e.g. haproxy and heartbeat) to do an automated failover in case your master goes down. Building a fully distributed multi-master setup is not possible with native Postgres as far as I know, there are commercial offerings like CitusDB that might help you with that though.
- Jonnax 7y agoHmm, well the scenario I was thinking of was having database writes sped up, in the sense of reducing network latency between the user and the server. I guess the syncing aspect is going to be most complicated part. I was thinking that I could have some logic that stores where the user's nearest DB is as part of their user info, and just store their data there. But still not sure if that's the best way. Thanks for mentioning Citrus DB, I looks like they have an open source version that I'll try checking out.