← Library
Course · by Yash Tiwari

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.

12 modules29 lessons planned2 published
01

Digital foundations

Everything a computer holds is a number. Meaning comes from agreements.

  1. 1.1Bits and bytesRead
  2. 1.2Counting in binary and hexRead
  3. 1.3Text: ASCII and UTF-8Soon
  4. 1.4Integers, floats and byte orderSoon
02

Architecture and execution

Your code does not run. Its compiled form does.

  1. 2.1The CPU, registers and instructionsSoon
  2. 2.2Compiling, linking and loadingSoon
03

Memory

Memory is the real speed limit.

  1. 3.1Registers, caches, RAM and diskSoon
  2. 3.2Pointers, the stack and the heapSoon
  3. 3.3Virtual memory and pagingSoon
04

Operating systems

Your program never touches a disk. It asks the kernel.

  1. 4.1The kernel and system callsSoon
  2. 4.2Processes, threads and schedulingSoon
  3. 4.3Files, descriptors and the page cacheSoon
05

Runtimes

A language is an abstraction with a price.

  1. 5.1Runtimes, allocation and garbage collectionSoon
06

Networking

TCP is a stream of bytes, not a stream of messages.

  1. 6.1IP, TCP and UDPSoon
  2. 6.2Sockets and message framingSoon
  3. 6.3DNS, HTTP and TLSSoon
07

Concurrency

Two clients arrive at once. Someone’s data had better survive.

  1. 7.1Race conditions and locksSoon
  2. 7.2Queues, worker pools and asyncSoon
08

Storage

Machines crash. Durability is designed, not given.

  1. 8.1Append-only logs and indexesSoon
  2. 8.2fsync and what durability meansSoon
  3. 8.3Write-ahead logs and crash recoverySoon
09

Backend communication

The network drops, duplicates and delays.

  1. 9.1Timeouts, retries and idempotencySoon
  2. 9.2Backpressure and overloadSoon
10

Distributed systems

Many machines can half-work, and that is much harder.

  1. 10.1Partial failure and failure detectionSoon
  2. 10.2Replication and consistencySoon
  3. 10.3Consensus and leader electionSoon
11

Scaling and observability

Scaling is choosing which problem to have, and you cannot fix what you cannot see.

  1. 11.1Finding the bottleneckSoon
  2. 11.2Logs, metrics, traces and percentilesSoon
12

Putting it together

Parts working is not the same as a system working.

  1. 12.1Verifying bitkv end to endSoon