How databases, networks and distributed systems work
Semicolony is a set of articles and simulators for software engineers. Each article covers one system, such as Raft, Kafka, Git or a B-tree, and most have a simulator next to them where you can change the inputs and watch the result. Everything runs in your browser.
- DNS Turn www.example.com into an IP addressSimulator
- TCP Open a connection with a three-way handshakeSimulator
- TLS Check the certificate and agree on keys
- Load balancer Pick one of many servers to handle itSimulator
- Cache Answer from memory if it canSimulator
- Database Find the rows through an indexSimulator
- HTTP response Send the page back to the browserSimulator
…and the browser draws the page. All guides
Four ways in
Long-form study paths, from distributed systems and databases to Kubernetes, Linux and language guides.
One guide per system, in the order things happen, with a link to a simulator where there is one.
Models you can change and break: adjust the inputs, take a server down, let time pass, and see what the system does.
Reading orders that string the guides, simulators and Codex pages together for one kind of job.
Try one here
This is a least recently used (LRU) cache with room for three keys. Get a key that is already in it and it moves to the front. Get a new one when it is full and the key at the back is thrown out. Try A, B, C, then A, then D.
The full LRU simulator shows the hash map and linked list behind it, and compares LRU with the best possible policy.
Press a key to get it from the cache.
Simulators rebuilt from scratch
Every number and log line in these comes from the simulation itself, and each comes with a full article.
- Raft Five servers electing a leader and copying a log, message by message.
- DNS resolution A resolver following referrals from the root and caching by TTL.
- Load balancer Four algorithms on the same traffic, and a server that slows down.
- B-tree Why a database index is only three or four levels deep.
- LRU cache A hash map and a linked list, and when LRU loses to the optimal policy.
- Consistent hashing Adding a server without moving most of the keys.
- CAP theorem What a replicated database does when the network splits.
- Bloom filter Answering "is this in the set?" in a few bits per item.
- Rate limiter Token buckets and sliding windows, request by request.
Guides, by layer of the stack
44 guides, each about one system. See them all with descriptions.
Codex study paths
Long-form pages grouped by subject. The number is how many pages each path has.