Raft Visualization
thesecretlivesofdata.com
thesecretlivesofdata.com
Unfortunately, the visualization project is effectively dead. The Raft visualization involved a lot of painful D3.js coding and effectively writing a JS Raft implementation. In hindsight, a deterministic format would be much easier. I toyed around with learning After Effects in hopes of producing some other visualization videos but I never did finish any.
I'm glad folks are still getting value out of the Raft visualization. The paper is good but it helps to see data move over time to really make it click.
The internet is a fickle place...
[1] Intro https://www.youtube.com/watch?v=UzzcUS2OHqo
[2] Part I: https://www.youtube.com/watch?v=64Zp3tzNbpE
[3] Part II https://www.youtube.com/watch?v=4r8Mz3MMivY
[4] Playlist for the course: https://www.youtube.com/watch?v=cQP8WApzIQQ&list=PLrw6a1wE39...
Does anyone know if there are projects/libraries to help build this kind of visualization more generically? I realize that no library could every cover every possible use case, but I'd love some kind of framework that makes it easy to build out this kind of thing.
Reveal [1] is great for a web-based slideshow, but I'd love something that helps explain complex systems, even if that requires me to do some heavy lifting.
https://web.stanford.edu/~ouster/cgi-bin/papers/raft-atc14
I'd estimate it took me about 2 hours to get through it, but it felt very satisfying because I walked away saying "yup, I see how this works now". Give it a shot!
Turns out this was requested about two years ago, and hasn't been responded to by the developers. :(
https://github.com/benbjohnson/thesecretlivesofdata/issues/2...
Looking at the project commit history, although there was a minor commit (changing a URL) in 2020, the newest commit before that was 2014.
Seems like a dead project. Oh well, the idea was good. :)
Edit: sometimes
If you run any of these systems in production, it is good to have a cursory understanding.
And CockroachDB both use raft consensus https://www.cockroachlabs.com/docs/stable/architecture/repli...
In vanilla Raft, reads are appended to the Raft log like writes are. This means in order to commit a write, the client and the leader on the "majority" side will update the value as normal. The second client will either be unable to find a leader to contact at all, or if it is connected to an old leader, the leader will not be able to replicate the log entry necessary to service the read from the second client.
There are lease optimizations that rely on bounded clock error that allow for performing reads from the leader without appending entries to the log. Note this relies on the rate at which the clock advances, not the actual time.
There are also optimizations from Paxos research that would allow reading from the followers, but those also require contacting the leader at minimum.
In summary, Client One will succeed and Client Two will fail.
https://medium.com/swlh/replication-and-linearizability-in-d...
you mean atomic clocks as in spanner?
https://cloud.google.com/spanner/docs/true-time-external-con...
Raft is essentially Multi-Paxos under the hood, with some overstrict invariants that can impact availability and latency. If you need a consensus algorithm, then it's worth doing a survey of the literature beyond Raft.
Other Multi-Paxos variants are Viewstamped Replication Revisited, which has deterministic leader election for lower latency in the common case and thus no issue of split votes, and which I personally find easier to understand than Raft, also making less demands of the underlying hardware (i.e. VRR can do in-memory leader election, so you're safe in the event of disk failure, corruption, lost writes, and misdirected writes, which Raft does not deal with).
For all these Multi-Paxos variants, you can also look at Flexible Paxos, which is a simple technique for making leader election quorums slightly more expensive (since leader elections are infrequent) in order to make replication quorums much cheaper (since they are the common case critical path). You can use Flexible Paxos to save 20% in the number of hardware nodes for the same common case failure tolerance. Flexible Paxos is a game changer.