The ladders to memorize, the side-by-side comparisons that come up in every design review, and every term from the 12 chapters.
| LSM-tree | B-tree | |
|---|---|---|
| Writes | Sequential appends; high throughput | In-place page overwrites |
| Reads | May check several SSTables | One root-to-leaf path |
| Space | Compaction removes garbage; compresses well | Fragmentation; pages partly empty |
| Pain point | Compaction can stall writes | Write amplification via WAL + page |
| OLTP | OLAP | |
|---|---|---|
| Reads | Few records by key | Aggregates over many rows |
| Writes | Random, low latency | Bulk loads (ETL) or streams |
| Users | End users via the app | Analysts, BI dashboards |
| Storage | Row-oriented | Column-oriented, compressed |
| Batch | Stream | |
|---|---|---|
| Input | Bounded, known size | Unbounded, arrives forever |
| Latency | Minutes to hours | Milliseconds to seconds |
| Failures | Rerun the failed task | Checkpoints, idempotence |
| Example | MapReduce, Spark | Kafka Streams, Flink |
An application whose main challenge is the amount, complexity or rate of change of data, rather than CPU power.
Able to automatically add computing resources when load increases.
The system as a whole stops providing the required service to the user.
The number of downstream requests or writes triggered by one incoming request, as in delivering a tweet to every follower.
One component of the system deviating from its specification.
Designing a system so that faults are prevented from causing failures.
A few slow requests holding up the processing of requests queued behind them.
Numbers that describe load, e.g. requests per second, read/write ratio, active users or cache hit rate.
How easy a system is to operate, understand and change over its lifetime: operability, simplicity, evolvability.
The system continues to work correctly, at the desired performance, even in the face of faults and human error.
The response time below which a given share of requests fall — p50 is the median, p99 means 99% are faster.
A system's ability to cope with increased load, discussed in terms of concrete load parameters.
Moving to a more powerful machine (vertical) versus spreading load across many machines (horizontal, shared-nothing).
The high-percentile (p99, p999) response times experienced by the slowest requests.
Neo4j's declarative query language for property graphs, using arrow-style patterns.
Storing related data together so it can be loaded in one go, as a document does for its nested data.
The abstraction used to represent data — relational tables, JSON documents, graphs — which shapes how problems are solved.
A rule-based query language from the 1980s whose ideas underpin many graph query languages.
A query that describes the result wanted, leaving the database to decide how to compute it (e.g. SQL).
Data stored as self-contained documents (often JSON) that can nest one-to-many structures.
The awkward translation layer between objects in application code and tables, rows and columns.
Relationships where many records refer to one (or many) others; they require joins to query.
Storing each piece of information in exactly one place and referring to it by ID, avoiding duplication.
A graph model where vertices and edges each have a label and a set of key–value properties (Neo4j, Cypher).
Data organized into relations (tables) of tuples (rows), queried declaratively, proposed by Edgar Codd in 1970.
The structure of data is implicit and interpreted only when data is read (like dynamic typing).
An explicit schema enforced by the database, so all written data conforms to it (like static typing).
A graph store that keeps every fact as a (subject, predicate, object) triple, queried with SPARQL.
A file that is only ever added to at the end — the simplest and fastest way to write data.
A balanced tree of fixed-size pages updated in place; the most widely used index structure.
A compact probabilistic structure that can say a key is definitely absent, avoiding unnecessary disk reads.
Storing all values of each column together, so queries read only the columns they need.
Rewriting log segments to discard overwritten or deleted values, keeping only the latest value per key.
A separate, read-optimized database for analytics, loaded from OLTP systems via ETL.
An in-memory hash map from each key to the byte offset of its value in a data file, as in Bitcask.
An additional structure derived from primary data that speeds up reads at the cost of slower writes.
Log-Structured Merge-tree: a storage engine built on memtables and SSTables that are merged in the background.
An in-memory sorted tree that buffers recent writes before they are flushed to disk as an SSTable.
Online transaction processing (small key-based reads/writes for users) vs online analytic processing (large aggregate scans).
Sorted String Table: an immutable segment file whose key–value pairs are sorted by key.
A warehouse layout with a central fact table of events referencing surrounding dimension tables.
A special record marking a key as deleted, so compaction knows to discard earlier values.
One logical write causing multiple physical writes to disk over the database's lifetime.
An append-only file to which every change is written before it is applied, used for crash recovery.
A compact binary encoding from Hadoop with no field tags, decoded by resolving writer's and reader's schemas.
Newer code can read data that was written by older code.
Translating in-memory data structures into a self-contained sequence of bytes; decoding is the reverse.
The number that identifies a field in Thrift/Protobuf encodings; it must never change or be reused.
Older code can read data that was written by newer code, ignoring parts it doesn't understand.
An intermediary that stores messages and delivers them to consumers asynchronously (e.g. RabbitMQ, Kafka).
A binary encoding of JSON that is somewhat smaller but still includes field names in every record.
Google's schema-driven binary encoding that identifies fields by numeric tags.
A design philosophy for web services built on HTTP features, URLs and simple data formats.
Deploying a new version to a few nodes at a time, so old and new versions run side by side.
Remote procedure call: making a request to a remote service look like calling a local function.
Changing a schema over time while keeping old and new data and code compatible.
Facebook's schema-driven binary encoding and RPC framework, with Binary and Compact protocols.
In Avro, the schema used to encode the data versus the schema the decoding application expects.
If writes stop, replicas eventually converge to the same value — with no bound on how long that takes.
Promoting a follower to leader after the old leader fails, then redirecting writes to it.
A replica that applies the leader's changes in the same order and serves reads.
Resolving conflicts by keeping the write with the largest timestamp and discarding the rest.
The single replica that accepts writes and decides their order in leader-based replication.
A guarantee that a user never sees older data after having seen newer data.
Several nodes accept writes and replicate to each other; useful across datacenters and for offline clients.
Requiring w write acks and r read responses out of n replicas so the read and write sets overlap.
A guarantee that users always see their own updates after making them (read-after-write consistency).
Keeping copies of the same data on several machines for availability, lower latency and read scaling.
The delay between a write on the leader and that write appearing on a follower.
Two nodes both believing they are the leader and accepting conflicting writes.
The leader waits for a follower to confirm a write before reporting success — durable but blocks if the follower stalls.
One version counter per replica, used to tell whether two writes are causally ordered or concurrent.
A key whose first part picks the partition by hash while the remaining parts stay sorted within it (Cassandra).
Splitting a partition when it grows too large and merging small ones, like a B-tree (HBase, MongoDB).
Creating many more partitions than nodes up front, so rebalancing moves whole partitions, not keys.
A secondary index partitioned by the indexed value; fast reads, slower and often asynchronous writes.
Assigning keys to partitions by a hash of the key — even load, but no efficient range queries.
A partition (or key) receiving a disproportionate share of the load.
Assigning each partition a contiguous, sorted range of keys — efficient range scans, risk of hot spots.
A secondary index where each partition indexes only its own records; reads must scatter/gather.
A subset of the data; each record belongs to exactly one partition.
Moving partitions between nodes as data, load or the set of nodes changes.
Deciding which node should handle a request, via any node, a routing tier or a partition-aware client.
Sending a query to every partition and combining the results; latency is set by the slowest partition.
Uneven distribution of data or load, so some partitions do much more work than others.
Atomicity, Consistency, Isolation, Durability — the safety guarantees transactions aim to provide.
If a transaction fails partway, all its writes are undone — abortability, not concurrency.
Seeing another transaction's uncommitted writes.
Two concurrent read-modify-write cycles where one overwrites the other's change.
Multi-version concurrency control: keeping several committed versions of each row to implement snapshots.
A write in one transaction that changes the result of a search query in another.
Isolation level preventing dirty reads and dirty writes; the default in many databases.
Seeing different parts of the database at different points in time within one transaction (nonrepeatable read).
The strongest isolation level: the outcome equals running the transactions one at a time, in some order.
Each transaction reads from a consistent snapshot of the database as of its start.
Serializable snapshot isolation: optimistic — run on snapshots and abort at commit if a premise read has changed.
A group of reads and writes executed as one unit that either commits entirely or aborts entirely.
Pessimistic serializability: shared and exclusive locks held until commit, so readers and writers block each other.
Two transactions read the same data, then update different rows based on a premise the other invalidated.
A network with no upper bound on message delay; messages can be lost, delayed or duplicated.
A node behaving arbitrarily or maliciously — sending corrupted or false messages.
The difference between the clocks of two machines at the same instant.
A monotonically increasing number issued with each lease so storage can reject writes from stale holders.
A lock with a timeout: the holder owns a resource until the lease expires, unless it renews it.
A clock that only moves forward; suitable for measuring durations, not for comparing across machines.
A network fault that cuts some nodes off from others while each group keeps running.
Some parts of a distributed system fail while others keep working, often nondeterministically.
A thread stopping unexpectedly — GC, VM suspension, swapping — without realizing time passed.
Safety: nothing bad ever happens. Liveness: something good eventually happens.
A formal set of assumptions about timing (synchronous, partially synchronous, asynchronous) and node failures.
A wall clock returning time since the epoch; synced by NTP and able to jump backward.
Giving up on a response after a fixed time — the only practical fault detector, unable to tell slow from dead.
The property of packet-switched networks that queueing can make a message arbitrarily late.
During a network partition a system must choose between linearizability and availability.
Operations that are causally related are seen in the same order by everyone; concurrent ones may differ.
Atomically set a value only if it currently equals an expected value; a building block for locks and uniqueness.
Getting nodes to agree on a value with agreement, integrity, validity and termination despite failures.
A monotonically increasing term/ballot number identifying a leader's reign in consensus algorithms.
A 2PC participant that voted yes but hasn't heard the decision, so it holds locks and waits.
A (counter, nodeID) pair where nodes bump their counter past any value they see, giving a total order consistent with causality.
Makes a replicated system appear to have a single copy of the data, with each operation taking effect atomically at one instant.
A protocol that delivers messages reliably and in the same order to all nodes; equivalent to consensus.
An atomic commit protocol: a coordinator asks participants to prepare, then tells all to commit or abort.
A standard API for two-phase commit across heterogeneous databases and message brokers.
Coordination services offering linearizable, totally ordered storage for locks, leader election and membership.
Running a job over a large, bounded input to produce derived output, measured by throughput.
A map-side join that loads a small input into an in-memory hash table on every mapper.
Storing raw data in its original form first and deciding how to interpret it later.
Systems like Spark, Tez and Flink that run a whole workflow as a graph of operators, pipelining data between them.
Hadoop Distributed File System: a shared-nothing filesystem that splits files into replicated blocks across machines.
A key with disproportionately many records, overloading the single task that processes it.
A programming model: mappers emit key-value pairs, the framework sorts and shuffles by key, reducers combine each key's values.
HDFS's central server that tracks which machines store which file blocks.
A graph-processing model where vertices exchange messages along edges in synchronous supersteps.
Partitioning, sorting and copying mapper output so each reducer receives all values for its keys.
A reduce-side join where both inputs are keyed by the join key so matching records meet in the same reducer.
Small programs that do one thing well, connected through a uniform text-stream interface.
A tool (Airflow, Oozie, Luigi) that runs chains of dependent batch jobs.
Slowing down a producer when consumers can't keep up, instead of dropping or buffering without bound.
Capturing every change written to a database and publishing it as a stream for other systems.
How far a consumer's offset is behind the head of the log.
The position in a log partition up to which a consumer has processed messages.
A small, immutable record of something that happened at a point in time.
Storing all application state changes as immutable domain events and deriving current state from them.
When an event actually occurred versus when a processor handles it.
Results are as if each event were processed once, despite failures and retries.
Discarding older log entries for a key, keeping only the latest value, so the log stays bounded.
A broker like Kafka that stores messages in an append-only, partitioned log consumers read by offset.
An event that arrives after its window was considered complete.
Enriching each event with data from a table kept current locally via change data capture.
Ways to group events in time: fixed non-overlapping, fixed overlapping, relative-interval, and activity-based.
Continuously checking data integrity, e.g. by re-deriving views or using cryptographic hashes.
A later action that corrects an earlier one, such as a refund or an apology for overbooking.
Data created by transforming other data — caches, indexes, views — that can be rebuilt from the source.
A guarantee like duplicate suppression can only be fully provided with the help of the endpoints of the whole path.
A unified query interface over many underlying stores (unifies reads).
An operation that has the same effect whether it runs once or many times.
Running a batch layer and a stream layer side by side and merging their outputs.
A unique identifier generated by the client so a retried request can be recognised and applied only once.
The authoritative source of truth for some data; other representations are derived from it.
Seeing up-to-date state (temporary if violated) versus having no corrupted or lost data (permanent if violated).
Composing specialised storage and processing tools around a log instead of relying on one monolithic database.
Work done eagerly when data is written versus lazily when it is requested.