5 ms·
Have you looked at Fly.io ? https://fly.io/docs/introduction/ https://fly.io/docs/introduction/
by rtcoms 5y ago
Have you looked at Fly.io ?
https://fly.io/docs/introduction/ https://fly.io/docs/introduction/
- throaway_pirate 5y agoI have! However, (correct me if I'm wrong) they don't solve the database issue. You still have a single region with a "leader", and other regions just have read-replicas.
- verdverm 5y agoGoogle Cloud Spanner is a SQL database for this problem. There is an open source version iirc, forget the name
- throaway_pirate 5y agoWow this looks awesome! This could definitely be what I'm looking for. Thanks so much!
- plmpsu 5y agoCockroachDB
- mrkurt 5y agoYou're not wrong, but most global databases work exactly like this. They just let you assign ranges of data to leaders, rather than doing it DB by DB. Shopify uses exactly the same model we (Fly.io) do, it's a slightly more evolved version of what you're doing. They run leaders in multiple regions with read replicas scattered around, and then assign the most appropriate leader region to a store. CockroachDB and Spanner let you move ranges of data to different "leaders" within the cluster. If you model your schema well, they work great. But you do have to worry that queries aren't spanning regions or you end up making everything slow. The Fly.io magic is the proxy layer that replays entire HTTP requests to the leader region. It works surprisingly well. If your databases is even close to half reads and half writes, something similar may work nicely.