Bits to Distributed Systems: Build one key-value store, layer by layer
Start at a single bit and climb to replicated systems, with one project (a key-value store called bitkv) that grows alongside the ideas: bytes, memory, the OS, the network, storage and failure.
Digital foundations
Everything a computer holds is a number. Meaning comes from agreements.
- 1.1Bits and bytesRead
- 1.2Counting in binary and hexRead
- 1.3Text: ASCII and UTF-8Soon
- 1.4Integers, floats and byte orderSoon
Architecture and execution
Your code does not run. Its compiled form does.
- 2.1The CPU, registers and instructionsSoon
- 2.2Compiling, linking and loadingSoon
Memory
Memory is the real speed limit.
- 3.1Registers, caches, RAM and diskSoon
- 3.2Pointers, the stack and the heapSoon
- 3.3Virtual memory and pagingSoon
Operating systems
Your program never touches a disk. It asks the kernel.
- 4.1The kernel and system callsSoon
- 4.2Processes, threads and schedulingSoon
- 4.3Files, descriptors and the page cacheSoon
Runtimes
A language is an abstraction with a price.
- 5.1Runtimes, allocation and garbage collectionSoon
Networking
TCP is a stream of bytes, not a stream of messages.
- 6.1IP, TCP and UDPSoon
- 6.2Sockets and message framingSoon
- 6.3DNS, HTTP and TLSSoon
Concurrency
Two clients arrive at once. Someone’s data had better survive.
- 7.1Race conditions and locksSoon
- 7.2Queues, worker pools and asyncSoon
Storage
Machines crash. Durability is designed, not given.
- 8.1Append-only logs and indexesSoon
- 8.2fsync and what durability meansSoon
- 8.3Write-ahead logs and crash recoverySoon
Backend communication
The network drops, duplicates and delays.
- 9.1Timeouts, retries and idempotencySoon
- 9.2Backpressure and overloadSoon
Distributed systems
Many machines can half-work, and that is much harder.
- 10.1Partial failure and failure detectionSoon
- 10.2Replication and consistencySoon
- 10.3Consensus and leader electionSoon
Scaling and observability
Scaling is choosing which problem to have, and you cannot fix what you cannot see.
- 11.1Finding the bottleneckSoon
- 11.2Logs, metrics, traces and percentilesSoon
Putting it together
Parts working is not the same as a system working.
- 12.1Verifying bitkv end to endSoon