CodingLevel 4

Backend internals

Easynot started
Mediumnot started
Hardnot started
Network & protocol parsingThe network delivers a continuous stream of bytes. You must find the message boundaries yourself.3 minDatabase internalsHow databases physically execute queries, like joining two tables together efficiently.3 minStorage data structuresHow modern databases achieve massive write throughput using LSM Trees.3 minDistributed algorithmsCoordinating data across multiple machines using Consistent Hashing.3 minChanging an API people already useOnce someone else's code depends on yours, the only safe way to change it is to make the new thing true before the old thing stops being true.7 minGossip disseminationOne machine tells a few, they each tell a few, and the whole fleet knows in a handful of rounds.3 minCopy-on-write snapshotsFreeze a volume in an instant by sharing blocks, and only copy one the moment someone writes to it.3 minAnti-entropy convergenceHow distributed replicas gossip to heal silent data divergence.3 minCounting how much storage a tenant usesKeep one honest number, bytes used, and nudge it on every write and delete, so you always know whether the next write still fits.3 minCovering indexAnswering queries without ever visiting the actual table.3 minCRDT OR-set (replica merge)How two offline devices magically merge their shopping carts without conflicts.3 minDatabase query optimizerHow the database decides the fastest way to fetch your data.3 minEncoding and schema evolutionTurn a record into compact bytes with numbered fields, so old and new code can still read each other's data.4 minHow a cost-based optimizer picks a query planThe database estimates what each possible plan would cost, then runs the cheapest one.5 minHybrid logical clocksHow distributed databases figure out which event happened first when their wall-clocks are out of sync.3 minLSM tree compactionCleaning up the mess of append-only log files.3 minMAC addressesEvery network card is born with a permanent name tag, and a switch quietly learns who sits on which port just by reading the return address on passing mail.4 minPercent-decodingA URL can only safely carry a small alphabet, so every other byte travels disguised as %XX, decoding is just reading those disguises back into bytes.4 minRead repair across replicasA read is a chance to notice that a replica fell behind, and to quietly hand it the fresh value on the way out.3 minRead-through cacheKeep a hot copy of slow data nearby, so most reads never have to touch the database.4 minSecondary indexLooking up data when you don't know the Primary Key.3 minSloppy quorum with hinted handoffWhen the home replicas are unreachable, accept the write on healthy backups and hand it back once the originals recover, so writes stay available during a partition.4 minStorage allocator (slab + free list)Grab one big slab of memory up front, then hand out fixed-size blocks from a free list so every alloc and free is just a pointer move.4 minVersioned storeKeep every snapshot, never the eraser, a write adds a new page instead of rubbing out the old one.3 minReading a huge file with mmapHand the whole file to the kernel as addresses, and pay for disk reads only when you actually touch a page.4 min