7 ms·
Consensus algorithms underly distributed databases like Cassandra, or distributed caches like Redis. (in fact Redis does use a version of Raft). Simple use cas
by galenmarchetti 3y ago
Consensus algorithms underly distributed databases like Cassandra, or distributed caches like Redis. (in fact Redis does use a version of Raft).
Simple use case, you're running a database across three servers, so that users can ping any one of the servers and it still works (fault tolerance).
User X pings server A to write something to a table. User Y pings server B to read from that table.
How do you make sure that User Y reads what User X wrote, so that User X and User Y are on the same page with what happened?
That's the consensus algo
- couchand 3y agoNot to be too pedantic, but the step of actually shipping those changes across servers is usually outside the scope of consensus algorithms. Generally they are limited to picking a single server to act as a short-term leader. That server then is responsible for managing the data itself. Though you can conceive of a system where all data flows through the consensus algorithm, practically speaking that would introduce significant overhead at a granularity where it isn't adding value. There isn't neceasarily one dictator for the whole cluster, but rather usually they are scoped to each domain that requires serialization.