10 parts · 10 chapters

Algorithms Backends Run On

The backend mirror of the frontend Algorithms course: the algorithms inside the infrastructure you use every day. Every rate limiter, cache cluster, database, queue and service mesh is built from a small set of them. Measured here: Redis's HyperLogLog counted a million distinct ids with 0.40% error in 14 KB.

Ten parts: rate limiters; consistent and rendezvous hashing; Bloom and cuckoo filters, HyperLogLog and count-min sketches; B-trees and LSM trees side by side; skip lists; schedulers, priority queues and timing wheels; compression; Merkle trees and anti-entropy; backoff, jitter and load-balancing algorithms; and Raft implemented in code.

rate limiters · consistent and rendezvous hashing · probabilistic structures · B-trees and LSM trees · skip lists · schedulers and timing wheels · compression · Merkle trees · backoff and load balancing · Raft in codemid → staff · backend and infrastructure engineers
limitsToken bucket, leaky bucket, fixed and sliding windows.
placementConsistent hashing, rendezvous hashing, jump hash.
sketchesBloom, cuckoo, HyperLogLog, count-min: approximate answers in tiny memory.
storageB-trees, LSM trees and skip lists in real databases.
timeHeaps and timing wheels for millions of timers.
agreementMerkle trees for repair; Raft for consensus, in code.
Built on DSA and Distributed SystemsUses DSA for foundations and Distributed Systems for the theory; each part points at the course where the algorithm appears in production.