Blog
Notes on data structures & algorithms, system design, and things I learn along the way.
Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→'Is it alive?' and 'can it take traffic?' are different questions with different consequences: one restarts the process, the other just routes around it. How liveness, readiness and startup probes work, and the one mistake that turns a database blip into a full outage.
Several servers need to agree on one ordered log, even when some crash. How Raft elects a leader with terms and randomized timeouts, why a majority is the magic number, and how replication and stale leaders are handled — the consensus algorithm behind etcd and many databases.
Light in fibre is fast, but not fast enough to cross the world many times per page load. How a content delivery network caches your files at edges near users, what it can and can't cache, and how to control it with headers and purges.
ACID promises a lot, but the I — isolation — comes in levels, and the default one still lets concurrent transactions overwrite each other. What dirty reads, non-repeatable reads, phantoms and lost updates are, and the fixes that actually work.
When one server can't keep up, you can buy a bigger one or add more. Why scaling up is the right first move, why it eventually stops working, and what scaling out really costs: stateless servers, load balancers, and shared state.
A webhook is an API calling you instead of you calling it. How to verify that a request really came from the provider, why you should acknowledge fast and process later, and how to handle the retries, duplicates and out-of-order events that always come.
Machine clocks drift, so timestamps can't tell you which of two events in a distributed system came first. Logical clocks can — Lamport clocks give a consistent order, vector clocks tell you whether an order exists at all.
A request timed out. Did the charge go through? The client can't know, so it has to retry — and the server has to make that retry harmless. How idempotency keys work, and the race conditions a naive implementation misses.
B-trees update pages where they live. LSM trees buffer writes in memory, flush them as immutable sorted files, and merge those files in the background. How the memtable, SSTables, tombstones and compaction fit together — and what reads pay for it.
OFFSET is a position in a result set that keeps changing, and it gets slower the deeper you go. A cursor is a value in the data. When each one is the right answer.
47 posts tagged System Design · page 3 of 5