System Design Beyond the Basics
Glossary
150 terms from System Design Beyond the Basics, in plain words, each with the chapter that teaches it.
#
- 80/20 rule
- About 20% of the data (the hot data) gets about 80% of the reads. Kettle & Crane therefore caches only that share of its customer profiles.
A
- ack (acknowledgement)
- A confirmation from a replica that it stored a write. A quorum write waits for W acks before it counts as done.
- Active-active
- In active-active, both regions serve customers at once. In active-passive, one region serves while the other only keeps copies and waits. Kettle & Crane chooses active-active.
- Adaptive bitrate
- The video player measures its connection speed and fetches each next segment from the rendition that fits. A slow connection drops to 480p instead of stalling.
- Anycast
- A method where several regions share one IP address and the internet's routing sends each user to the nearest one. It is an alternative to geo DNS.
- API gateway
- One front door that checks every request, for example against rate limits, before the app sees it.
- API key
- A secret string that a client such as a café's software sends to identify itself. It is also used as the key for rate limits.
- Assumption
- A guess you choose to work with and state out loud, such as "I'll assume 60,000 orders a day".
- Asynchronous replication
- The leader confirms a write at once and followers catch up later. It is fast, but a crash can lose the latest writes.
- At-most-once
- The consumer commits before processing. There are no duplicates, but a crash after the commit loses the event, so it's fine for view counts and never for orders.
- Atomic increment
- One step that adds to a counter and returns the new value, such as Redis's INCR. It stops two servers from both reading 4 and both writing 5.
B
- Bandwidth
- A network link's throughput, counted in bits per second (Mbps means millions of bits per second). Since a byte is 8 bits, 1 MB a second needs 8 Mbps.
- bisect
- A Python module that searches a sorted list by halving. `bisect` finds where a value would go, `insort` inserts in order, and `bisect_left` finds where a prefix would go.
- bit
- A single 0 or 1. A byte is 8 bits, and network links are rated in bits per second.
- Blob
- A file's raw bytes, such as a product photo or a class video. Blobs go in object storage, with facts about them kept in the database.
- BM25
- The standard search ranking formula. Rare words count more than common ones, and long texts count a little less. FTS5 reports it as a negative score, so lower is better.
- Bottleneck
- The one component that limits the whole system, as a bottle's neck limits how fast it pours. For Kettle & Crane it is peak traffic, not storage.
C
- Cache busting
- Putting the content hash in a file's name, as in `mug-blue.3f9a1c.jpg`. A changed photo gets a new name, so the CDN can cache every name forever and never serve an old picture.
- Cassandra / DynamoDB
- Widely used databases that partition data with hashed rings and offer local and global secondary indexes.
- Causal consistency
- Effects never appear before their causes. For example, nobody sees Priya's reply to a review without the review.
- CDN (content delivery network)
- A network of servers near users that caches and serves files such as images and video segments. It makes heavy outgoing traffic cheap.
- Change data capture (CDC)
- Reading a database's own change log and publishing every change as an event. It is a reliable way to feed an event log.
- Chunk
- One piece of a large file in a multipart upload, say 8 MB. A failed chunk can be resent on its own.
- Committed (Raft)
- In Raft, a change is committed once a majority of nodes store it, and then it survives any later election.
- Committed offset
- The next event a consumer group will read in a partition, stored with `commit()`. After a restart the group carries on from it.
- Conflict
- Two writes to the same key happening at once in different places, which can occur with multi-leader or leaderless replication.
- Consensus
- Getting nodes to agree on one value or one order of changes, even when some fail. Raft and Paxos are algorithms for it.
- Consistency model
- A promise about what a read may return, from the strongest (linearizable) down to eventual. You choose one per feature.
- Consistent hashing
- Placing keys and nodes on a hash ring so that adding a shard moves only a fair share of keys, not most of them as `% n` does.
- Constant-time comparison
- A comparison that takes the same time whether the first or last character differs, so an attacker can't guess a signature by timing answers.
- Consumer group
- A named reader of a log with its own offset per partition. Each partition goes to one member of a group, and groups read independently of each other.
- Content hash
- A hash of a file's bytes, such as SHA-256. It checks that an upload arrived unchanged and lets identical files or chunks be stored once.
- Courier matching
- Assigning an order to the nearest courier. Positions are kept in memory in a grid of cells about 1 km across, and the search checks the order's cell and its 8 neighbors.
D
- Data center
- A building full of servers. A region is a group of data centers in one area.
- Data residency
- Laws in some countries that require their citizens' data to stay inside the country. Global shops need a region there.
- Deduplication
- Storing files or chunks with the same content hash only once.
- Deep dive
- A close look at one hard part of a design, such as how payments avoid double charges. You pick the part that holds the bottleneck.
- Dirty read
- Seeing another transaction's unfinished changes. The read committed isolation level prevents it.
- Distributed rate limiting
- Keeping one shared count per key in a fast store such as Redis, so a customer can't multiply their limit by the number of servers. If the store is down, each server falls back to a looser local limit.
- Double-entry ledger
- A record of money movements written as entries in two or more accounts that add up to zero. Mistakes are fixed with new entries, never by editing old ones.
E
- Egress
- Data leaving your network, which cloud providers charge for. For video it is the big cost, so a CDN serves it.
- Elasticsearch / OpenSearch
- Search engines that shard an index by document and answer queries by scatter-gather, with replicas of each shard sharing reads.
- Erasure coding
- Splitting data into pieces plus extra pieces computed from them, so lost pieces can be rebuilt without keeping three full copies.
- etcd / ZooKeeper
- Systems that store small shared facts, such as who leads or which shards exist, using consensus. You use them rather than writing consensus yourself.
- Event
- A record that something happened, such as an order being placed. A log keeps events in arrival order.
- Event streaming
- Building systems around a log that keeps events so that many readers can read them, now or later. Apache Kafka is the best-known tool.
- Eventual consistency
- If writes stop, all copies end up the same. It is fine for view counts and the product catalog, where a slightly old value hurts nobody.
- Exactly-once
- Each event's effect happens once. Kafka offers it inside Kafka, but a consumer that writes elsewhere must still be idempotent.
F
- Failover
- Switching to a healthy region when one fails. A failover drill turns a region off on purpose, at a quiet time, to measure the real RPO and RTO.
- Fair share
- The portion of keys a new shard should take, such as one fifth when going from 4 to 5 shards.
- Feed cache
- A cached list of the latest post IDs for each account. Posts from authors below a follower threshold are pushed into followers' lists, and bigger authors are pulled and merged at read time.
- Fencing token
- A number that grows with each new leader, such as its term. Storage rejects writes with a lower token, so an old leader's writes bounce.
- Fixed window counter
- A limiter that counts requests per key in fixed time windows, such as each minute. It needs one counter per key per window but allows a window edge burst.
- Fixture
- A pytest function marked `@pytest.fixture` that prepares what tests need. A test that names it as a parameter receives what it returns.
- Follower
- A node that holds a copy of the leader's data and applies its changes.
- FTS5
- sqlite's extension that keeps an inverted index for you in a virtual table. You query it with `MATCH` and rank with `bm25()`.
G
H
- Hash ring
- A circle of hash values from 0 to 4,294,967,295. A key belongs to the first node point reached going clockwise, wrapping around after the largest.
- hashlib
- Python's module of stable hash functions such as MD5 and SHA-256. Use it instead of `hash()`, whose results change between runs.
- Headroom
- Spare capacity for surprises, kept by planning servers at about 70% load. A server that handles 300 requests a second counts as 210.
- heapq.nlargest
- A function from Python's `heapq` module that returns only the k items with the largest key, biggest first, without sorting everything.
- Hex digits
- Base-16 digits, where `a` to `f` stand for 10 to 15. `.hexdigest()` returns a hash in hex, and `int(text, 16)` turns it into a number.
- HLS (HTTP Live Streaming)
- A common video streaming format in which each rendition is cut into short segments listed in a playlist.
- HMAC
- A hash of a message mixed with a secret key. Anyone can read the URL, but only the secret's holder can make a matching signature.
- Home region
- The region that holds a customer's account and orders and serves them, chosen from their shipping state. It keeps writes in one place and avoids conflicts.
- Hot key
- A key that gets far more traffic than others, such as a famous café's feed. Even spreading doesn't help, so it is split by key salting.
I
- Idempotent
- Safe to repeat: doing it twice has the same effect as once. Consumers and payment calls are made idempotent, for example by skipping order IDs already shipped or sending an idempotency key.
- Idempotent insert (primary key, INSERT OR IGNORE)
- A primary key is a column whose value may appear only once in a table, so each order ID exists once. sqlite's `INSERT OR IGNORE` silently skips a row whose key already exists, so a retried order is stored once; the prototype's `make_shard()` builds an in-memory database with such an `orders` table.
- Integrity
- Assurance that bytes arrived unchanged, checked by comparing a content hash computed after upload with the one the browser sent.
- Inverted index
- A dict from each word (token) to the set of documents containing it, like the index at the back of a book.
- Isolation level
- How much transactions running at once can see of each other. Read committed, snapshot isolation and serializable prevent progressively more problems at progressively lower speed.
J
- Jitter
- A small random extra delay added to retries, so that many clients refused at once don't all retry at the same moment.
K
- Kafka
- The best-known event streaming tool. It keeps topics split into partitions, uses consumer groups, and (version 4) runs on KRaft.
- Key salting
- Splitting a hot key into parts by adding a suffix such as `#0` to `#3`. Writes pick a part at random and reads fetch all parts.
- KRaft
- Kafka's own Raft-based consensus, which replaces ZooKeeper in Kafka 4.
L
- Last-write-wins (LWW)
- A conflict rule that keeps the write with the later timestamp and drops the other. It can cause a lost update, so it suits only data like a "last viewed" time.
- Latency
- How long one piece of work takes, measured in milliseconds (ms), microseconds (µs) or nanoseconds (ns). Memory reads take about 100 ns and a trip across an ocean about 150 ms.
- Leader
- A node that accepts writes and sends its changes to its followers. Leader election is followers voting for a new leader by majority when the old one goes quiet.
- Leaderless replication
- Any replica accepts writes, and the client writes to several at once. Quorums decide what a read sees.
- Leaky bucket
- A cousin of the token bucket: requests join a queue that drains at a steady rate, smoothing bursts instead of allowing them.
- Lifecycle rules
- Rules that move or delete stored objects by age, such as moving to archive after 90 days.
- Linearizable
- The system behaves like a single copy of the data: once a write is confirmed, every later read by anyone sees it. Stock and payments need it.
- Local / global index
- A local secondary index is kept per partition: writes stay on one shard but a query asks every shard. A global index is partitioned by the indexed value: a query asks one place, but a write touches two shards and the index can lag.
- Log
- A record that keeps every event in arrival order, unlike a queue that deletes a message once handled, so many readers can read it now or later.
- Lost update
- A write that vanishes with no error, such as Sam's note dropped by last-write-wins.
M
- Majority
- More than half of all nodes, counting the candidate itself. Two majorities of the same cluster always share a node, so two leaders can't win the same term.
- Merge
- Combining conflicting versions instead of dropping one, such as taking the union of two carts or keeping both notes for a person to choose.
- Metadata
- The facts about a file, such as its name, size, owner, type and storage location. They are kept in a database row, apart from the blob.
- Monotonic reads
- You never go back in time: once you've seen version 5, you never get version 4. It stops an order from vanishing on refresh.
- Multipart upload
- Splitting a large file into chunks sent in parallel and retried one by one. An upload cut off halfway resumes from the last chunk that arrived.
N
- Network partition
- A network failure that cuts nodes into groups that can't talk to each other. It can leave an old leader isolated, causing split brain, and forces a choice between consistency and availability.
- Non-repeatable read
- A row changing between two reads in one transaction. Read committed still allows it and snapshot isolation prevents it.
O
- Object key
- The name a blob is stored under in object storage, for example `products/mug-blue/1.jpg`. The database row holds the key.
- Object storage
- A service such as Amazon S3 that stores blobs, each under an object key. Browsers can upload to it directly with signed URLs.
- Offset
- An event's position in its partition, starting at 0. A reader can replay events by reading again from an old offset.
P
- p99
- A latency figure where 99 of 100 requests are faster than it.
- Partition (of a topic)
- One ordered list of events within a topic. Partitions spread across brokers to spread load, and order exists only within one partition.
- Partitioning (sharding)
- Splitting data across several databases (shards) by a shard key, such as customer ID, so each holds only part of it. A hash ring decides which shard owns each key.
- Paxos
- An older consensus algorithm that solves the same problem as Raft.
- Peak RPS
- The most requests a second the system must handle: the daily average (requests ÷ 86,400) times a peak factor such as 10. It is the number used to size servers.
- Posting set
- The set of documents (SKUs) containing one word in an inverted index. An AND query intersects the posting sets.
- pytest
- A Python testing tool. `pytest.raises` checks that code raises a particular error.
Q
- Quorum
- Enough replicas to decide: a write waits for W acks and a read asks R replicas. If W + R > N, a read always overlaps the latest write.
R
- Raft
- The most common consensus algorithm. It elects a leader by majority, numbers each election as a term, and commits log changes once a majority stores them.
- Ranking
- Putting the best search matches first by relevance, a score for how well a document fits the query. The simplest score is term frequency, counting how often the query's words appear.
- Rate limiter
- A mechanism that caps how many requests one client may make in a period. It protects servers from bursts and buggy scripts and shares capacity fairly.
- Read-your-writes
- You always see your own writes, so "saved" looks saved to you. A session achieves it by reading only from replicas at least as new as its own last write.
- Rebalancing
- Moving data when shards change, done in the background: copy the moving keys while the old shard still serves them, switch the ring, then delete the old copies.
- Reconciliation
- Comparing your records with a partner's report, such as a nightly job that checks the ledger against the payment provider's report and flags differences.
- Redis
- A fast in-memory store used for shared rate-limit counts and courier locations. A Lua script inside Redis makes a multi-step read-and-write one atomic step.
- Region
- A cloud provider's group of data centers in one area, such as Oregon or Virginia. Kettle & Crane runs in us-west and adds us-east.
- Reindex
- A job that rebuilds the search index from the database to repair drift. The indexer is the worker that updates the index when a product event arrives.
- Rendition
- One quality level of a video, such as 1080p at 5,000 kbps or 480p at 1,000 kbps.
- Replay
- Reading events again from an old offset. It works because a log keeps events until retention removes them.
- Replica
- One copy of a piece of data on another node. Quorum stores keep N replicas of each key, and a read or write must reach enough of them.
- Retention
- How long a topic keeps its events, say 7 days, whether or not anyone has read them.
- Retry-After header
- An HTTP header on a 429 Too Many Requests response saying how many seconds to wait before trying again.
- RPO / RTO
- RPO (recovery point objective) is how much recent data you may lose in a disaster, measured in time. RTO (recovery time objective) is how long recovery may take; for example, replication lagging up to 2 seconds gives an RPO of about 2 seconds, and 3 minutes to detect an outage plus 10 to switch regions gives an RTO of about 13 minutes.
S
- Scatter-gather
- Sending a query to every shard, taking each shard's top results and merging them. It is only as fast as the slowest shard, so give each shard a timeout.
- Secondary index
- An index for finding rows by something other than the shard key, such as orders for `MUG-BLUE` when orders are sharded by customer.
- Secrets manager
- A service for storing real secrets, which should live there or in an environment variable, never in code.
- Segment
- A few seconds of video, such as 4, fetched as one file and listed in a playlist.
- Session guarantee
- A cheap promise to one user's session, not to everyone, such as read-your-writes or monotonic reads.
- Signed URL
- A link to storage that works only as issued and until its expiry time, proved by an HMAC signature. It lets browsers upload or download directly without the app carrying the bytes.
- Sliding window log
- A limiter that stores each allowed request's time and counts only those in the last window. It is exact but needs memory for one timestamp per request.
- Source of truth
- The authoritative copy of data, here the product database. The search index is a copy built for fast reading.
- Split brain
- Two nodes both believing they lead, for example an old leader cut off by a network partition. Fencing tokens guard against it.
- sqlite
- A small, file-based SQL database engine that ships with Python and can also run entirely in memory. It supports features such as FTS5 full-text search, and a program can use one separate database per shard.
- State machine
- A list of the states something can be in and the moves allowed between them; every other move is refused. A payment goes created → authorized → captured, or fails, so a late retry can't capture a failed payment.
- Stop words
- Very common words, such as "the", dropped from search because they don't help rank.
- Storage classes
- Tiers that trade price for speed: hot storage for product photos, cheaper cold or archive storage for old raw videos.
- Synchronous replication
- The leader waits for followers to have a write before confirming it. Nothing is lost if the leader dies, but every write waits for the slowest follower.
T
- Term
- A leader's numbered period in Raft. Each election starts a new term, and a node that hears of a higher term steps down.
- Threshold
- The follower count, 10,000 here, below which a post is pushed to followers' feeds and above which it is pulled at read time.
- Throughput
- How much work a system finishes per second, as opposed to how long one piece takes (latency).
- Thumbnail
- A small copy of a photo, such as 200 or 800 px wide, made by a worker after upload.
- Token bucket
- A limiter where each key has a bucket of up to capacity tokens. Each request spends one and tokens refill at a steady rate, so a quiet client saves up a burst.
- Tokenize
- Lowercasing text and splitting it into words, called tokens, as the first step of building an inverted index.
- Topic
- A named stream of events in Kafka, split into partitions. Each consumer group reads a topic with its own offsets.
- Trade-off
- What you give up to get something. A senior answer states each choice's cost, as in "We choose X because Y. The cost is Z."
- Transactional outbox
- Writing the order and its event row in one transaction, with a relay that publishes the row, so a crash can't lose the event.
- Transcoding
- Converting an uploaded video into several renditions cut into segments.
- Typeahead
- Suggesting names as the user types. In a sorted list, `bisect_left` finds where the typed prefix would go.
V
- Version
- A number that grows with each change, used to pick the newest answer in a quorum read and to give session guarantees.
- Version vector
- One counter per replica, which real systems keep to tell a real conflict from one write simply following another.
- Virtual node (vnode)
- One of many points a shard owns on a hash ring. Many small arcs average out, so keys spread evenly.
- Virtual table
- In sqlite, something that looks like a table but whose data is stored and searched by a module, as FTS5 does.
W
- Window edge burst
- A fixed window's weakness: a client sends the full limit just before and after a boundary, getting double through in a second.
- Write skew
- Two transactions each check a rule, then both write and together break it, such as two baristas each seeing the other on shift and both signing off. Snapshot isolation still allows it.