Library / Papers
Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases (paper)
Why Aurora moves the redo log to a distributed storage layer, so replication and crash recovery become cheap.
By Verbitski et al. · Amazon Web Services · Added 2026-10-12
All content belongs to Verbitski et al. / Amazon Web Services. We only link to it and give credit. Report a problem
Study path: How big storage systems are builtFrom spreading keys over servers to a database built for the cloud.
0 of 7 finished- 1Consistent Hashing and Random Trees (paper)
- 2CAP Twelve Years Later: How the Rules Have Changed
- 3Amazon Dynamo: Highly Available Key-Value Store
- 4Bigtable: A Distributed Storage System for Structured Data (paper)
- 5Cassandra: A Decentralized Structured Storage System (paper)
- 6Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases (paper)
- 7Facebook’s photo storage
Next: Facebook’s photo storage
Learn this paper
About 37 min left. Your work is saved as you go.
What you are about to study
Amazon Web Services wrote this paper. Read the abstract and headings first. It assumes you are comfortable with distributed systems.
Ideas you will meet
- Databases
- Schemas, indexes, query plans and choosing a store.
- Replication
- Leader/follower, multi-leader and leaderless replication.
- Storage Engines
- Write-ahead logs, B-trees and LSM-trees.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
System Design Foundations · 11 minChoosing and using a databaseRelational versus NoSQL, what an index really does, and how to decide between them without following fashion.Read here
The two big families
Relational databases (PostgreSQL, MySQL) store data in tables with rows and columns, linked by keys. You query them with SQL and can join tables. Their key promise is ACID transactions:
- Atomicity: a group of changes happens entirely or not at all.
- Consistency: rules such as foreign keys always hold.
- Isolation: concurrent transactions do not see each other's half-finished work.
- Durability: once committed, data survives a crash.
NoSQL databases is a loose label for stores that give up some relational features for scale or flexibility:
Type Shape Examples Good for Key-value key maps to a blob Redis, DynamoDB caches, sessions, huge lookups Document JSON-like documents MongoDB, Firestore content with varied fields Wide-column rows with flexible columns Cassandra, HBase massive write volumes, time series Graph nodes and edges Neo4j relationship-heavy queries A quick map from the kind of question you ask to the kind of store that answers it best:
100%Figure SDA-FND-04-1 · Which kind of store fits the questions you ask · © forcsguy.com
Image: MarkBuckawicki · CC0 · Source · Wikimedia Commons: Wooden Card Catalog FurnitureIndexes: how reads get fast
Without an index, finding rows where
email = '[email protected]'means reading every row. With an index onemailthe database keeps a sorted structure (usually a B-tree) and finds the row in a few steps, even among millions.100%Figure SDA-FND-04-2 · Indexed lookup versus full scan · © forcsguy.com
The trade-off: each index takes space and every write must update it. Index the columns you filter, join and sort on, and do not index everything.
Useful habits:
- Look at how the database plans a query (
EXPLAIN) before guessing. - A composite index on (user_id, created_at) serves queries on user_id alone or on both, but not on created_at alone. Column order matters.
- Very low-variety columns (like a true/false flag) rarely benefit from an index.
Where relational databases get strained
A single relational database handles a lot, but you may hit limits:
- Read load: add copies that serve reads (lesson 5).
- Write load or data size: split the data across several databases, called sharding (lesson 5).
- Shape of data: huge volumes of simple records, or extremely flexible documents, may fit another model better.
Choosing: ask about the access pattern
- What are the most frequent queries? By key, by range, by search, by relationship?
- Which guarantees are non-negotiable? Strict consistency for money, or "eventually correct" for like counts?
- How big and how fast will it grow?
- What does the team already know how to operate?
A worked example: what an index is worth
A table holds 100 million orders, and the app asks "show this customer's orders" thousands of times a second.
- Without an index the database reads every row to find matches: a sequential scan. At, say, 200 bytes a row that is 20 GB read from disk or cache for a single query, taking seconds. Do that 1,000 times a second and the database collapses.
- With a B-tree index on
customer_idthe database walks a shallow tree. A page holds a few hundred keys, so 100 million rows need only about 4 levels: root, two internal levels, a leaf. That is roughly 4 page reads to find the row locations, then a few more to fetch the rows. Most of the upper levels live in memory, so the real cost is one or two disk reads, in milliseconds.
The price: every index must be updated on every insert, update and delete. A table with 5 indexes turns one logical insert into about 6 physical writes, and the indexes take space (often as much as the table). So index what your queries actually filter, join and sort on, and not much else.
100%Figure SDA-FND-04-3 · Finding one row among a hundred million with a B-tree · © forcsguy.com
What a transaction does for you
A transaction groups several changes so they succeed or fail together. A transfer of 100 from account A to account B is two updates, and it must never be applied halfway. Relational databases give transactions the ACID properties:
- Atomic: all of it happens or none of it.
- Consistent: rules such as "balance never negative" are enforced.
- Isolated: concurrent transactions do not see each other's half-finished work (to a degree you choose).
- Durable: once the database says "committed", the change survives a crash.
Durability comes from the write-ahead log (WAL): before changing the data pages, the database appends the change to a log and forces it to disk. If the machine crashes, restart replays the log and the committed work reappears.
100%Figure SDA-FND-04-4 · Why a committed write survives a crash · © forcsguy.com
You can build a toy version in the write-ahead log lab.
Mistakes people make
- No index on the column you filter by, especially foreign keys. Use
EXPLAINto see whether a query scans. - Too many indexes. Each one slows writes and uses memory. Drop the ones nobody uses.
- The N+1 query. Loading 100 orders and then running one query per order for its items is 101 round trips. Load them together with a join or a single
INquery. - Money as floating point. Use integers (cents) or exact decimals.
- Choosing NoSQL to avoid thinking about schema. If your data is relational, you will rebuild joins and constraints by hand, badly.
- Treating the database as a queue or a log. Polling a hot table for work is a common cause of lock contention (see the SKIP LOCKED lesson for doing it properly).
- Never testing a restore. A backup you have not restored is a hope, not a backup.
Try it yourself
Open the indexes in depth lesson and the query optimisation lesson next. In the System Builder, see how much load a cache and replicas take off a single database.
Real-world reading
Related reading
- Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases (paper)Verbitski et al. · Amazon Web ServicesPapers
- Minimizing Read-Write MySQL Downtime at YelpYelp engineers · YelpCase Studies
- Sherpa: Distributed NoSQL Key-Value Store at YahooYahoo engineers · YahooCase Studies
- Use The Index, LukeMarkus Winand · use-the-index-luke.comCourses
Show 6 moreShow fewer
- Fast Order Search using Data Pipeline and Elasticsearch at YelpYelp engineers · YelpCase Studies
- MPH: Fast and Compact Immutable Key-Value Stores at IndeedIndeed engineers · IndeedCase Studies
- Espresso: Distributed Document Store at LinkedInLinkedIn engineers · LinkedInCase Studies
- MongoDB at Baidu: Multi-Tenant Cluster Storing 200+ Billion Documents across 160 ShardsMongodb engineers · MongodbCase Studies
- Relational DatabasesMysql engineers · MysqlCase Studies
- Document DatabasesMicrosoft engineers · MicrosoftCase Studies
Advanced Distributed Systems · 13 minWrite-ahead logs, B-trees and LSM-treesHow databases make writes durable and fast: the log first, then two ways of organising data on disk and the trade-offs between them.Read here
Durability needs a log
A database holds data in memory pages for speed, but memory is lost on a crash. To be durable it must put a record of every change on disk before it tells the client "committed". That record is the write-ahead log (WAL): an append-only file of changes.
100%Figure SDA-ADS-02-1 · Write-ahead log flow · © forcsguy.com
The same idea appears everywhere: databases, file systems (journaling), message brokers (the log is the data) and replication (followers replay the primary's log).
Two ways to organise data on disk
B-trees: update in place
A B-tree keeps sorted keys in fixed-size pages arranged as a shallow tree. Finding a key takes a few page reads; changing a key updates a page in place (plus a WAL record for safety).
- Strengths: predictable reads, efficient range scans, mature, used by most relational databases.
- Costs: writes touch random pages (random I/O); page splits and fragmentation; every write is written twice (WAL and page).
LSM-trees: append and merge
A log-structured merge tree buffers writes in a sorted in-memory table (the memtable), also logged to a WAL. When full, it is flushed as an immutable sorted file (an SSTable). Background compaction merges files and discards overwritten and deleted values.
100%Figure SDA-ADS-02-2 · LSM-tree write and read path · © forcsguy.com
- Strengths: very fast sequential writes, good compression, high write throughput.
- Costs: a read may check several files (helped by bloom filters and caches); background compaction creates write amplification and I/O spikes; deletes leave tombstones until compaction.
Choosing
Question B-tree LSM-tree Write-heavy ingestion Slower Faster Point reads and range scans Steady Good, depends on compaction Predictable latency Easier Compaction can add tail latency Space usage Some fragmentation Temporary extra during compaction Typical users PostgreSQL, MySQL (InnoDB) Cassandra, RocksDB, HBase, many time-series stores There is no winner: choose by workload, and measure. This lesson explains why a store behaves the way it does under load, which helps when diagnosing slow writes or sudden I/O spikes.
Related ideas
- Checkpoints and snapshots bound recovery time.
- Replication often ships the WAL to replicas.
- Fsync policy (flush every write, or every few milliseconds) is a durability versus speed knob.
- Bloom filters appear in the probabilistic-structures lesson of the core-concepts course.
Real-world reading
Related reading
- The Log-Structured Merge-Tree (paper)O'Neil et al. · UMass BostonPapers
- Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases (paper)Verbitski et al. · Amazon Web ServicesPapers
- RocksDBMeta · GitHubGitHub
- ClickHouse BlogClickHouse engineers · ClickHouseBlogs
Show 6 moreShow fewer
- The Google File System (paper)Ghemawat, Gobioff and Leung · GooglePapers
- Inside the Magic PocketDropboxCase Studies
- Database InternalsAlex Petrov · O'ReillyBooks
- How SQLite WorksSQLite team · SQLiteDocumentation
- Bigtable: A Distributed Storage System for Structured Data (paper)Chang et al. · GooglePapers
- Tumblr Engineering BlogTumblr engineers · TumblrBlogs
Databases Deep Dive · 12 minReplication topologies and multi-region databasesSingle-leader, multi-leader and leaderless replication, how they handle conflicts and lag, and what changes across regions.Read here
Why replicate
Replication keeps copies of data on several machines for three reasons: availability (survive a node failure), read scaling (serve reads from replicas) and latency (put data near users). The hard part is keeping copies consistent while writes continue. (Basics are in the replication and sharding lesson of the foundations course; this lesson compares the topologies.)
Single-leader (primary and replicas)
One node, the leader (primary or master), accepts writes and ships its changes to followers (replicas), which serve reads.
100%Figure SDA-DDV-04-1 · Single-leader replication · © forcsguy.com
- Synchronous replication waits for a follower before acknowledging: safer, slower, and a stalled follower can block writes. Asynchronous is faster but a failover can lose the latest writes. A common compromise: one synchronous follower, others asynchronous.
- Failover must detect failure, choose the most up-to-date replica, redirect clients and ensure the old leader does not come back believing it still leads (split brain).
- Replication lag causes stale reads. Techniques: read-your-writes (route a user's reads to the leader shortly after they write), monotonic reads (keep a user on one replica), and checking replica position.
Multi-leader
Several nodes accept writes (often one per region) and replicate to each other. Benefits: local write latency and continued operation if a region is cut off. Cost: write conflicts.
Conflict handling options:
- Avoid them: route all writes for one record to one leader (for example by user or region).
- Last write wins by timestamp: simple, but silently drops one of two concurrent updates and depends on clocks.
- Merge values (union of sets, counters) using mergeable data types (CRDTs; see the collaborative editing lesson).
- Custom resolution in application code, or ask the user.
Multi-leader also appears in offline-capable apps (each device is a leader) and collaborative editing.
Before: single leader
100%After: multi-leader across regions
100%What changed
- Users in each region write to a nearby database
- Concurrent edits to the same row need conflict handling
- More moving parts to run and monitor
Leaderless (Dynamo-style)
Any replica accepts writes; clients write to several replicas and read from several, using quorums (
W + R > N) to get fresh data (see the key-value store lesson). Background anti-entropy and read repair fix stale copies; versions or vector clocks detect conflicts. It favours availability and is typical of Cassandra and DynamoDB-style stores.100%Figure SDA-DDV-04-2 · Choosing a replication model · © forcsguy.com
Multi-region designs
- Active-passive: one region serves writes; another is a warm standby. Simple; failover loses a little data (the replication lag) and takes minutes.
- Active-active: several regions serve traffic. Requires either partitioning data by home region (each record has one home, cross-region reads are replicas) or true multi-leader conflict handling.
- Global databases use consensus across regions (see the consensus lesson) for strong consistency at the cost of cross-region write latency; some offer tunable consistency per query.
- Latency numbers matter: a cross-ocean round trip is around 100 ms or more, so synchronous cross-region replication adds that to every write.
- Data residency laws may require keeping certain users' data in a region.
Partitioning and replication together
Real systems shard data into partitions and replicate each partition (a leader per partition spreads write load across nodes). Rebalancing, hot partitions and cross-partition transactions are the new problems (see sharding and the consistent-hashing lesson).
Master/slave naming
You will see "master/slave", "primary/replica" and "leader/follower" for the same single-leader idea; most current documentation prefers the last two.
Checklist
- What happens to writes if the leader or a region is lost, and how long?
- How much data can we lose (RPO) and how long can we be down (RTO)?
- How do we handle stale reads from replicas?
- Who resolves conflicts, and how?
- Have we practised failover?
Real-world reading
Related reading
- Active-Active for Multi-Regional ResiliencyNetflix Engineering · NetflixCase Studies
- Designing Data-Intensive ApplicationsMartin Kleppmann · O'ReillyBooks
- Read Consistency with Database Replicas at ShopifyShopify engineers · ShopifyCase Studies
- Uber Schemaless: A Scalable MySQL DatastoreUber Engineering · UberCase Studies
Show 6 moreShow fewer
- Mitigating MySQL Replication Lag and Reducing Read Load at GithubGithub engineers · GithubCase Studies
- Cassandra architecture overviewApache Cassandra · Apache Software FoundationDocumentation
- How Discord Stores Trillions of MessagesBo Ingram · DiscordBlogs
- Spanner: Google's Globally Distributed Database (paper)Corbett et al. · GooglePapers
- Scaling Multitenant Architecture Across Multiple Data Centres at Shopify - Weingarten, Engineering Lead at ShopifyShopifyYouTube
- MIT 6.824: Distributed SystemsRobert Morris · MITCourses
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases (paper).
Warm upGet the vocabulary first.
Books · Free from the author
Readings in Database Systems (the Red Book)
Essays and papers on how database systems are built, with an introduction to each, free online from the editors.
Red BookAdvanced
Books
Database Internals
How storage engines and distributed databases work, from B-trees and LSM-trees to consensus and replication.
O'ReillyAdvanced
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs
Cockroach Labs Blog
Distributed SQL internals: consensus, transactions and multi-region design.
Cockroach LabsAdvanced
Papers
Megastore: Providing Scalable, Highly Available Storage (paper)
Synchronous replication across data centres with Paxos while keeping a transactional data model.
GoogleAdvanced
See it in another companyThe same ideas, a different system.
Case Studies · Read here
ZippyDB: Facebook's key-value store
Facebook's strongly consistent key-value store built on RocksDB and Paxos, with data sharded and replicated.
MetaAdvanced
Case Studies · Read here
Inside the Magic Pocket
How Dropbox built its own exabyte-scale block storage, including durability and cost choices.
DropboxAdvanced
Read the codeSee how it looks when it is real.
GitHub
CockroachDB
A distributed SQL database built on ranges, Raft and MVCC.
GitHubAdvanced
GitHub
Apache Cassandra
The source of the wide-column, leaderless database.
GitHubAdvanced
Keep learning
Loading community…