2 ms·
> Second, your application can only serve requests from that one server. If you fired up your server in Dallas then that'll be snappy for Texans. But your users
by hinkley 4y ago
> Second, your application can only serve requests from that one server. If you fired up your server in Dallas then that'll be snappy for Texans. But your users in Chennai will be cursing your sluggish response times since there's a 250ms ping time between Texas & India.
> To improve availability, it uses leases to determine the primary node in your cluster. By default, it uses Hashicorp's Consul.
Having a satellite office become leader of a cluster is one of the classic blunders in distributed computing.
There are variants of Raft where you can have quorum members that won't nominate themselves for election, but out of the box this is a bad plan.
If you have a Dallas, Chennai, Chicago, and Cleveland office and Dallas goes dark (ie, the tunnel gets fucked up for the fifth time this year), you want Chicago to become the leader, Cleveland if you're desperate. But if Chennai gets elected then everyone has a bad time, including Dallas when it comes back online.
- benbjohnson 4y agoGood catch. LiteFS has an option to mark nodes as candidates or not. For example, you can run a cluster with a couple candidate nodes in one region (e.g Chicago) and every other region may just run a single non-electable replica. We don’t support any kind of tiering for candidates in different regions. That’s not a bad idea though.