Cheatsheet
21 published · 63 queuedOne unit a day, from a fixed curriculum: concepts, algorithms, data structures and patterns. Nothing here is generated per day, so an entry reads the same on edition 400 as on edition 1.
distributed systems
9BackpressureConcept
A queue that cannot say no is a queue that will fall over.
CAP, In PracticeConcept
You do not choose between C and A; you choose what to do during a partition.
CRDTsConcept
Data types whose merge function is associative, commutative and idempotent — so replicas converge without coordination.
Consistent HashingConcept
Adding a node should move 1/n of the keys, not all of them.
Exponential Backoff with JitterConcept
Retries without jitter re-synchronise your clients into a self-inflicted DDoS.
Idempotency KeysConcept
The client picks a unique key so a retried request runs at most once.
RaftConcept
Consensus you can actually hold in your head: one leader, an append-only log, a majority.
Read-Your-Writes ConsistencyConcept
The weakest guarantee that stops a user seeing their own edit vanish.
Vector Clocks and Logical TimeConcept
Wall clocks cannot order events across machines; counters can.
databases
5Connection Pooling and Pool ExhaustionConcept
A Postgres connection is a process; the pool is the real concurrency limit.
Index SelectivityConcept
An index helps only when it eliminates most of the table.
LSM TreesConcept
Trade read amplification for write throughput by never updating in place.
MVCCConcept
Readers never block writers because each sees its own snapshot of history.
Write SkewConcept
Two transactions that are individually correct can break an invariant together.
architecture
3Circuit BreakerConcept
Stop calling a dependency that is already failing, so you fail fast instead of piling up.
Saga PatternConcept
No distributed transaction: a sequence of local commits, each with a compensating undo.
Transactional OutboxConcept
The only reliable way to both commit a row and publish an event.
performance
2False SharingConcept
Two threads touching different variables on the same cache line fight over it.
Thundering Herd and Cache StampedeConcept
One expired key, a thousand simultaneous recomputations.
data structures
1Bloom FiltersData structure
A few kilobytes that tell you, with no false negatives, what is definitely absent.
concurrency
1Structured ConcurrencyConcept
A task cannot outlive the scope that started it.