Posts tagged “distributed-systems”
-
What happens when you type a search into Google and press Enter?
A tour from the keystroke to the painted page: the browser, DNS, TCP/TLS vs QUIC, the edge, a query fanned out to thousands of index servers, and the response streamed back. What each step costs, what can fail, and why the slowest server decides how fast the page is.
-
How do you keep two systems consistent without distributed transactions?
An order in one database, its payment in another, and a process that can die between them. Dual writes, two-phase commit, sagas and the outbox, each run 1,000 times with crashes injected: what goes wrong, what recovers, and what two-phase commit's in-doubt transactions block.
-
How do you add a cache node without moving every key?
hash(key) % N moves 91% of keys when you add an 11th node. Consistent hashing, rendezvous hashing and jump hash move 9%. Measured on a million keys: keys moved, balance, lookup cost, and which one to pick.
-
Why isn't a Redis lock enough?
A Redis lock is a lease: it expires whether or not its holder is done. Measured with Redis 7.4 and PostgreSQL 17: a paused holder overwriting newer data, a release that frees someone else's lock, a cron job running twice, and what fixes each.
-
CAP or PACELC: what trade-off do you make when nothing is broken?
CAP describes the rare moment the network splits. PACELC adds the trade-off you make all day: a fresher answer costs latency. Measured on a PostgreSQL primary and replica: how often reading your own write is stale, what each synchronous_commit level costs, and what happens when the replica is gone.