03. Data & Storage: cheatsheets

11 lessons, one page each when printed.

System Design · 03. Data & Storage · 10 min · Beginner

SQL vs NoSQL

Five kinds of database, and how to pick the right one.

In short

SQL stores facts once in tables, joins them on demand and gives ACID transactions, at the cost of a fixed schema and harder scaling out. NoSQL is four families, each giving up some of that to do one job better.

Key-value is the simplest and fastest, document keeps an object whole, wide-column absorbs huge writes, and graph follows links. Choose by your questions, and start with SQL when unsure.

Key ideas

  • SQL means Structured Query Language, the way you ask a relational database questions. Examples: PostgreSQL, MySQL, SQL Server. (step 1)
  • When unsure, start with PostgreSQL. It does most jobs well, even JSON, and you can add a specialist store later when you can show a real need. (step 9)

Good to know

  • For money, stock and bookings, ACID is worth more than almost any speed gain. (step 3)
  • Great for sessions, caches, shopping carts, counters and feature flags. (step 5)
  • A good fit for catalogs, profiles and content, where you read one whole object at a time. (step 6)
  • Pick a graph database when the questions are about paths and connections, not about rows. (step 8)

Watch out

  • A flexible schema is not free: the rules still exist, just in your application instead of the database. (step 4)
  • Model your queries first, then your tables. Changing the questions later often means a new table. (step 7)
AppSQL (PostgreSQL)Key-value (Redis)Wide-column (Cassandra)Document (MongoDB)Graph (Neo4j)

Terms

Relational database
A database that stores data in tables of rows and columns, linked by keys.
Normalization
Splitting data into tables so each fact is stored only once.
Join
A query that combines rows from two tables by matching a column.
ACID
Atomic, Consistent, Isolated, Durable: the promises of a database transaction.
Schema
The fixed set of tables and columns that every row must follow.
Schema migration
A planned change to a table's structure, such as adding a column.
Key-value store
A database that stores a value under a key and can only look it up by that key.
Document database
A database that stores whole JSON-like documents, so one read returns a full object.
Wide-column store
A database that spreads partitions of wide rows over many servers for very high write rates.
Graph database
A database that stores nodes and links, and answers path questions quickly.

System Design · 03. Data & Storage · 10 min · Intermediate

Indexes

A sorted shortcut that turns a slow search into a fast lookup.

In short

Without an index, the database scans all 10,000,000 rows: 2,000 ms. A B-tree index finds one row in 4 page reads: 0.4 ms, and it also serves ranges and sorting.

Composite indexes follow the left-prefix rule, and covering indexes skip the table. Every index costs space and slows each write, so index the queries you actually run.

Key ideas

  • An index is an extra structure, kept up to date by the database, that trades storage and write time for read speed. (step 2)
  • Put the columns you compare with equals first, and a range column last. Check what the database really does with EXPLAIN. (step 6)

Good to know

  • The tree stays shallow and balanced as the table grows. 125 million rows still fit in 3 levels, and the database keeps the top levels in memory. (step 3)
  • In SQL you create it with one line: CREATE INDEX idx_users_email ON users (email); (step 4)
  • Cover your hottest queries, and keep the extra columns few and small. (step 7)

Watch out

  • A query that is fast on 1,000 test rows can be very slow on 10 million. The cost grows with the table. (step 1)
  • A hash index finds exact matches only. B-trees are the default because they handle ranges, sorting and exact matches. (step 5)
  • Reads get faster, writes get slower. For read-heavy tables that is a great trade; for write-heavy tables, think harder. (step 8)
  • Also do not index columns with few values (like a yes/no flag) on their own: they cannot narrow the search much. (step 9)
AppB-tree index on emailusers table (10M rows)

Key numbers

Rows checked
1
Query time
0.4 ms
Per insert
2 page writes

Terms

Full table scan
Reading every row of a table to find the ones that match, which gets slower as the table grows.
Index
A sorted extra structure that points to rows, so a search can skip most of the table.
Binary search
Finding a value in a sorted list by repeatedly discarding the wrong half.
B-tree
A shallow, balanced tree of disk pages, each holding hundreds of keys, used by most database indexes.
Index lookup
Walking from the root of the tree to a leaf, then following a pointer to the table row.
Range query
A query for values between two limits, which a sorted index answers by walking along its leaves.
Composite index
An index on several columns, sorted by the first, then the second, and so on.
Left-prefix rule
A composite index helps queries that use its first columns, in order, but not later columns alone.
Covering index
An index that holds every column a query needs, so the table is never read (an index-only scan).
Write amplification from indexes
Each insert, update or delete must also change every index on the table.
EXPLAIN
A command that shows how the database will run a query, including which index it uses.

System Design · 03. Data & Storage · 12 min · Advanced

Storage Engines

How a database really writes bytes to disk: B-trees and LSM-trees.

In short

Random writes are slow, sequential writes are fast. A B-tree updates pages in place and reads in about 4 page reads, with a write-ahead log for safety. An LSM-tree buffers in a memtable, flushes sorted files and merges them later.

Compaction and Bloom filters keep LSM reads under control. The price of the LSM write speed is more background work and more write amplification.

Key ideas

  • Fast writes and slow reads. Every real engine keeps the sequential write and adds a way to find data again. (step 2)
  • Commit speed now depends on a sequential log write, not on random page writes. This is how B-tree databases stay both safe and quick. (step 4)
  • The idea: turn many small random writes into a few big sequential ones. (step 5)
  • Neither design wins everywhere. B-trees favour reads and steady latency; LSM-trees favour heavy, continuous writes. (step 9)

Good to know

  • Reads are excellent and ordered range scans are easy. Most classic databases are built this way. (step 3)
  • Filters never give a false "not here", so no real key is ever missed. The only cost is an occasional wasted read. (step 8)
  • Choosing a database is partly choosing its storage engine. Know which one is under it. (step 10)

Watch out

  • SSDs have no head to move, but they still prefer big, ordered writes. The ideas below help on both. (step 1)
  • An update or a delete is just a newer entry (a delete is a marker called a tombstone). The old value stays in an older file until it is cleaned up. (step 6)
  • Compaction uses disk and CPU all the time. If it falls behind, files pile up and reads slow down. (step 7)
B-treeLSM files

Key numbers

Read cost
4 vs 3
Write amplification
5× vs 30×

Terms

Storage engine
The part of a database that decides how data is laid out on disk and how it is read and written.
Append-only log
A file that is only ever added to at the end, which makes writes fast and sequential.
B-tree
A sorted tree of fixed-size pages that is updated in place and needs very few page reads per lookup.
Write-ahead log (WAL)
A log that records each change on disk before the data pages change, so a crash can be repaired by replaying it.
Memtable
The sorted in-memory table where an LSM-tree puts new writes first.
SSTable
A sorted file written from a full memtable that is never modified afterwards.
LSM-tree
A design that buffers writes in memory and writes them to disk as sorted files that are merged in the background.
Compaction
Merging sorted files in the background to drop old versions and deleted keys and to keep reads fast.
Bloom filter
A small bit array that says a key is definitely not in a file, or maybe is, so most files can be skipped.
Write amplification
The bytes written to disk for each byte the application writes.

System Design · 03. Data & Storage · 10 min · Intermediate

Replication

Keep copies of the data on several machines, and handle what goes wrong.

In short

Replication keeps copies on several machines. A leader takes the writes and followers copy them; reads can come from followers, which cut the busiest server from 100% to 55% here.

The price is lag: asynchronous copies are a little behind, so fix the cases people notice with read-your-writes, and plan failover for the day the leader dies.

Key ideas

  • Replication means keeping the same data on several machines. It buys safety, spare read capacity, and data that sits nearer to users. (step 1)
  • Automatic failover trades a few lost writes for a short outage. Synchronous copies avoid the loss but slow every write. (step 8)

Good to know

  • One writer means no two machines can disagree about the order of writes. That keeps things simple. (step 2)
  • A common middle way: one synchronous follower (so a second copy always exists) and the rest asynchronous. (step 4)
  • You do not need strong consistency for everyone. Fix the cases where a person would notice. (step 6)

Watch out

  • This scales reads, not writes: every write still goes through the one leader and every follower. (step 3)
  • This is eventual consistency: if writes stop, the followers catch up. In between, they can disagree with the leader. (step 5)
  • Reads from the followers can carry on during this time, with older data. (step 7)
  • Multi-leader is hard to get right. Use it for multi-region writes or offline apps, and avoid it otherwise. (step 9)
  • Quorums are not magic: concurrent writes, sloppy quorums and clock choices can still return old data. Tune W and R: W = 1 is fast but weaker. (step 10)
UsersLeaderFollower 1Follower 2

Key numbers

Live copies
3
Busiest server
55%
Replication lag
100 ms
Stale reads
10%

Terms

Replication
Keeping the same data on several machines for safety, spare read capacity and nearness to users.
Leader and follower
The leader takes all writes and streams them to followers, which apply the same changes in the same order.
Read replica
A follower that answers read queries to take load off the leader.
Synchronous replication
The leader confirms a write only after the followers have it, so there is no lag but writes are slower.
Asynchronous replication
The leader confirms a write first and copies it afterwards, which is fast but leaves followers a little behind.
Replication lag
How far a follower is behind the leader, which can make reads from it return old data.
Read-your-writes
A guarantee that a user always sees their own recent writes, often by reading them from the leader.
Failover
Detecting a dead leader and promoting a follower to take its place.
Split brain
Two machines both believing they are the leader, which can corrupt data.
Multi-leader replication
Several leaders accept writes, usually one per region, and copy to each other, which makes conflicts possible.
Quorum (W + R > N)
Writing to W and reading from R of N copies so that the sets always overlap and a read sees the latest write.

System Design · 03. Data & Storage · 10 min · Intermediate

Sharding

Split one huge database across many machines, and pick how to split it.

In short

Sharding splits rows across servers, so 1.6B rows become 400M per shard on 4 shards. The shard key decides everything: range keys keep ranges together but make hot spots, hash keys spread the load but scatter ranges.

Keep common queries inside one shard, expect to ask all shards for the rest, and plan how to add shards before you need to.

Key ideas

  • Replication copies the same data. Sharding splits different data across machines. (step 1)
  • Range sharding is good for range scans and bad for hot spots; hash sharding is the opposite. Choose by your main queries. (step 6)
  • Plan for growth from day one: start with many small logical shards on few machines, so you can move whole shards later. (step 9)

Good to know

  • Now both the data and the writes are spread out. This is how a database scales past one machine's writes. (step 2)
  • Range queries stay on one or a few shards, because neighbouring keys live together. (step 3)
  • Pick a key with many different values that are used about equally often. (step 5)
  • A directory gives full control over placement. Many systems use it for a few special keys and hashing for the rest. (step 7)

Watch out

  • Any key that grows steadily (time, an auto-increment id) sends all new writes to the last range. (step 4)
  • Keep things that are used together on the same shard, for example all of a customer's orders and addresses. (step 8)
UsersRouterShard 1Shard 2Shard 3Shard 4

Key numbers

Shards
4
Rows per shard
400M
Hottest shard
25%

Terms

Sharding
Splitting the rows of one big table across several database servers, each holding a slice.
Shard key
The column the router uses to decide which shard a row belongs to.
Range sharding
Each shard owns a continuous range of the shard key, which keeps range scans on few shards.
Hot shard
A shard that gets far more traffic than the others, so adding shards does not help.
Hash sharding
Choosing the shard from a hash of the key, which spreads rows and traffic evenly.
Scatter-gather
Asking every shard the same query and merging the answers, needed when the key is not known.
Directory-based sharding
A lookup table says which shard holds each key, so keys can be placed and moved freely.
Cross-shard query
A query or transaction that touches several shards, which is slower and harder to keep correct.
Resharding
Changing the number of shards, which moves data; with hash % N most rows move.
Logical shards (buckets)
Many fixed small partitions mapped onto servers, so a new server takes whole buckets instead of reshuffling everything.

System Design · 03. Data & Storage · 10 min · Intermediate

Consistent Hashing

Add or remove a server and move only the keys that must move.

In short

Servers and keys share one hash ring; a key belongs to the next server clockwise. Adding or removing a server moves one arc, not the whole data set.

Virtual nodes even out the arcs, the next servers clockwise hold the copies, and a cache fleet loses only one slice when a server dies.

Key ideas

  • Servers and keys are hashed into the same space, so they can be compared directly. (step 2)
  • Adding a server only touches its clockwise neighbour. Every other server keeps all of its keys. (step 4)
  • Skip virtual nodes of a server you already chose, or two copies could end up on the same machine. (step 8)

Good to know

  • Looking up the owner is a binary search over the sorted server positions: O(log n). (step 3)
  • A stronger machine can get more virtual nodes, and so a bigger share: weights for free. (step 7)
  • Memcached clients, DynamoDB, Cassandra and many CDNs place data with a hash ring. (step 9)

Watch out

  • Ideally only about 1/5 of the keys would move: the share the new server should take. (step 1)
  • D now holds its own keys and C's. If C was busy, D can be overloaded: the next steps fix this. (step 5)
  • The busiest server sets the limit for the whole system, however idle the others are. (step 6)
hash ring · 0 → 2³²ADBC

Key numbers

Servers
4
Keys moved
13%
Biggest share
31%
Hit rate
90%

Terms

Modulo hashing (hash % N)
Placing keys with hash(key) % N, which moves most keys when N changes.
Hash ring
The hash space bent into a circle, with servers and keys placed on it by their hashes.
Clockwise ownership
A key belongs to the first server at or after its point, going clockwise.
Virtual nodes
Many points on the ring for each server, so the arcs, and the load, even out.
Replicas on the ring
Copies of a key kept on the next distinct servers clockwise.
Cache fleet
Many cache servers sharing the keys with a hash ring, so losing one loses only its slice.

System Design · 03. Data & Storage · 8 min · Intermediate

Unique IDs at Scale

Give every row a different id when many machines create rows at the same time.

In short

Auto-increment is perfect on one database and breaks with shards. UUIDs need no coordination but are 16 bytes and random. A ticket server hands out blocks; Snowflake packs time, machine and counter into 8 bytes.

Snowflake ids stay unique with no talking, sort by time and allow 4,096,000 ids a second per machine. Their one weakness is the clock, so guard against it going back.

Key ideas

  • Across 1,024 machines that is over 4,194,304,000 ids a second, more than any real system needs. (step 6)

Good to know

  • If one database is enough for you, auto-increment is the best choice. Do not leave it early. (step 1)
  • No coordination means no bottleneck, and ids can be made on a phone, in a browser or offline. (step 3)
  • This is what UUIDs lacked: ids that are unique everywhere and still in time order. (step 7)

Watch out

  • An id that is only unique inside one shard cannot be used to talk about a row across the system. (step 2)
  • Newer UUID versions (such as v7) put a timestamp first to fix the ordering. That is the same idea as Snowflake, coming up. (step 4)
  • Ids from different servers are only roughly in time order, because each server holds a block. (step 5)
  • Clock-based ids are only as good as the clocks. Use a time source you trust, and guard against going back. (step 8)
App server 1Id generatorDatabase

Key numbers

Id size
8 bytes
Ids per second
4,096,000/s each
Sorted by time
yes
Duplicate risk
none (guarded)

Terms

Auto-increment id
A counter inside one database that gives each new row the next number.
UUID
A 128-bit identifier, mostly random, that can be made anywhere without coordination.
Id collision
Two different rows getting the same id, which random 128-bit ids make practically impossible.
Ticket server
A small database that hands out blocks of ids so app servers can count locally.
Snowflake id
A 64-bit id made of a timestamp, a machine number and a per-millisecond counter.
Sequence number
The counter in an id that separates ids made by the same machine in the same millisecond.
Time-ordered ids
Ids that sort by creation time, so the newest rows are at the end of an index.
Clock skew
Clocks on different machines, or one clock over time, disagreeing or jumping, which can break clock-based ids.

System Design · 03. Data & Storage · 10 min · Intermediate

CAP & Consistency

When the network splits, a database must choose between answering and being right.

In short

Networks split, so every replicated system answers one question in advance: when the copies cannot talk, do we refuse (CP) or answer with what we have (AP)?

In normal times the same trade-off shows up as time: 92 ms for strong writes against 2 ms for eventual ones. Pick it per feature: strong for balances and locks, eventual for feeds and counters.

Key ideas

  • Every replicated database has the same job: keep the copies equal, even when machines and networks fail. (step 1)
  • When the link is fine, you can have both. CAP only forces a choice during a partition. (step 3)
  • You do not need strong consistency for everyone. You need it for what each user, or each action, depends on. (step 8)
  • Dynamo-style stores usually pick availability and latency; Spanner-style stores pick consistency in both cases. (step 9)

Good to know

  • Use CP when a wrong answer is worse than no answer: money, locks, leader election. etcd, ZooKeeper and Spanner behave this way. (step 4)
  • Use AP when being up matters more than being exact: shopping carts, likes, feeds. DNS, Cassandra and DynamoDB lean this way (both databases can be tuned). (step 5)
  • Most large systems read from nearby copies and accept a small delay. The gap is usually milliseconds, not hours. (step 7)

Watch out

  • Partitions are not rare events you can design away. Any network between machines can split, so you must decide what to do when it does. (step 2)
  • The farther apart the replicas, the slower every write. Light in fibre cannot be sped up. (step 6)
Alice (EU)Replica EUbalance 150Replica USbalance 150Bob (US)

Key numbers

Stale reads
your choice
Write time
2 ms to 92 ms

Terms

Network partition
A failure where machines are running but some cannot reach each other over the network.
CAP theorem
During a partition a system can keep either consistency or availability, not both.
Consistency (CAP)
Every read returns the latest write or an error.
Availability (CAP)
Every request to a working node gets an answer.
CP system
A system that returns errors on the side without a majority, so it never returns old data.
AP system
A system that keeps answering on both sides of a partition and merges the copies later.
Strong consistency
After a write completes, every later read anywhere sees it, as if there were one copy.
Eventual consistency
Copies may differ for a short time but become equal when no new writes arrive.
Read-your-writes
After you save a change, your own reads always show it.
Monotonic reads
A user never sees newer data followed by older data.
PACELC
If partitioned choose availability or consistency; else choose latency or consistency.

System Design · 03. Data & Storage · 12 min · Advanced

Consensus & Leaders

How a group of machines agrees on one leader and one order of writes.

In short

A leader needs votes from a majority of all nodes (3 of 5), so two leaders can never exist in the same term. Terms and heartbeats detect a dead leader, and a new election takes about 155–305 ms.

A write is committed when a majority holds it, so it survives any minority of crashes. Real systems that do this for you: etcd, Consul, ZooKeeper, Kafka's KRaft, and Paxos-based stores such as Spanner.

Key ideas

  • Consensus means a group of nodes agreeing on one value, such as who the leader is, even when some of them fail. (step 1)
  • A majority is the smallest group that any other majority must overlap with. That overlap is what makes agreement safe. (step 3)
  • Consensus is not only about electing a leader: it is also how the group agrees on the order of every command. (step 7)

Good to know

  • This is the idea behind Raft and Paxos. Raft is the easier one to learn, and etcd, Consul and Kafka's KRaft use it. (step 4)
  • Each follower picks a random timeout, so two nodes rarely become candidates at the same instant. If they do, the vote splits and a new term starts. (step 5)
  • A committed entry is safe because any future leader needs a majority, and that majority must include a node that has the entry. (step 8)
  • Use 3 for small clusters and 5 when you want to survive two failures. More than 7 makes every write slower for little gain. (step 10)

Watch out

  • A node cannot tell "the leader died" from "I cannot reach the leader". The rule must not depend on that guess. (step 2)
  • Too short a timeout causes needless elections on a slow network; too long means longer downtime after a real crash. (step 6)
  • While there is no leader, writes pause. Reads from followers may still work but can be old. (step 9)
Clientn1n2n4n3leadern5

Key numbers

Working leaders
1
Votes to win
3 of 5
Crashes survived
2
Failover time
155–305 ms

Terms

Leader
The one node that puts all writes in order while the others follow it.
Split brain
Two parts of a cluster each believe they have a leader and accept conflicting writes.
Quorum (majority)
More than half of all nodes; any two quorums share at least one node.
Term
An election number; each node votes once per term and the higher term wins.
Candidate
A node that has timed out, raised its term and is asking for votes.
Heartbeat
A small periodic message from the leader that tells followers it is alive.
Election timeout
How long a follower waits without a heartbeat before starting an election, chosen at random.
Replicated log
An ordered list of commands that every node applies in the same order.
Commit
An entry is committed once a majority of nodes has stored it, so it cannot be lost.
Raft
A consensus algorithm built on terms, majority votes and a replicated log; used by etcd and Consul.
Failover
Switching to a new leader after the old one crashes.

System Design · 03. Data & Storage · 12 min · Advanced

Transactions & Isolation

Make several changes all-or-nothing, even when many users change data at once.

In short

A transaction makes several changes all-or-nothing. Isolation decides what overlapping transactions can see: dirty reads, changing values and phantoms appear as you go down the levels.

Databases give isolation with locks (wait) or MVCC (snapshots). Across several databases a plain transaction is not enough; that needs sagas or two-phase commit, covered in the Architecture chapter.

Key ideas

  • A transaction groups several operations into one unit that behaves as a single step. (step 1)
  • A read-committed database blocks dirty reads, yet T2 still sees the world change under its feet. (step 5)
  • Higher isolation means fewer surprises and more waiting or retries. Pick the lowest level your rules can live with. (step 7)
  • Whenever you read, think, then write, ask what happens if someone else does the same at that moment. (step 10)

Good to know

  • Transactions give ACID: Atomic, Consistent, Isolated, Durable. Atomic and durable come from the write-ahead log; this lesson is about the I. (step 2)
  • PostgreSQL, MySQL InnoDB and Oracle all use MVCC. Reads do not block writes, and writes do not block reads. (step 9)

Watch out

  • Isolation bugs are rare, silent and hard to reproduce, because they depend on exact timing. (step 3)
  • Only the lowest level, read uncommitted, allows this. Almost every database defaults to something stronger. (step 4)
  • Phantoms break checks like "only 1 booking per room" or "at least 1 doctor on call", which look at a range of rows. (step 6)
  • Keep transactions short and touch rows in the same order everywhere. Never wait for a user's click inside a transaction. (step 8)
Transaction T1Transaction T2accountstotal $800

Key numbers

What T2 sees
$800
Anomaly
none

Terms

Transaction
A group of operations that the database treats as one unit.
Atomicity
All the changes of a transaction happen, or none of them do.
ACID
Atomic, Consistent, Isolated, Durable: the four promises of a database transaction.
Isolation
Overlapping transactions behave as if they had run one after the other.
Dirty read
Reading a change that another transaction has not committed yet.
Non-repeatable read
Reading the same row twice in one transaction and getting different values.
Phantom read
Running the same range query twice and seeing new rows appear.
Isolation level
A setting that decides which anomalies a transaction may see.
Serializable
The strongest level: the result equals running the transactions one at a time.
Two-phase locking
Take locks as you go and release them all at commit, so others wait.
Deadlock
Two transactions each wait for a lock the other holds; the database aborts one.
MVCC
Keep several versions of each row so readers use a snapshot and never wait for writers.
Lost update
Two transactions read the same value and both write back, so one change disappears.

System Design · 03. Data & Storage · 8 min · Beginner

Files & Media

Store photos and videos in object storage, and keep only a small record in the database.

In short

Keep files in object storage and a 1 KB metadata row in the database. The app signs a short-lived URL, the browser uploads straight to storage, and workers process the file in the background.

A CDN serves viewers, cutting storage reads from 200 to 10 GB a day, and chunked uploads let big files resume. The app servers handle only 200 MB/day instead of 500 GB/day.

Key ideas

  • Bytes go to object storage; facts about the bytes go to the database. (step 3)
  • At the end the client says "complete", and storage joins the chunks into one object. Unfinished uploads should expire so they do not cost money. (step 8)

Good to know

  • Object storage providers design for extreme durability: S3 advertises 11 nines, so losing a file is very rare. (step 2)
  • Uploads scale with the storage service, not with your servers. You can run a few small app servers. (step 5)
  • Keep the bucket private and let only the CDN read it. For private photos, give each viewer a signed link that expires. (step 7)

Watch out

  • A database is built for small rows you search and update. Big files make it slow and expensive. (step 1)
  • The app checks that the user is allowed to upload before signing, and sets limits: one key, the file type and a maximum size. (step 4)
  • Never trust a file because of its name or type header. Check the bytes before you serve them to other people. (step 6)
BrowserApp serverDatabaseViewersCDNObject storageWorkerUpload events

Key numbers

Database growth
100 MB/day
Bytes through app
200 MB/day
Upload time
2.0 s
Storage reads
10 GB/day

Terms

Blob in the database
Storing a file inside a database column; it makes the database large, slow and costly to back up.
Object storage
A service that stores files as objects found by key, such as S3, Google Cloud Storage or Azure Blob.
Bucket
A named container of objects in object storage.
Metadata row
A small database record about a file: owner, key, size, type and status.
Pre-signed URL
A temporary link, signed by the app, that lets one client read or write one object.
Direct upload
The browser sends the file straight to object storage instead of through the app server.
Processing pipeline
Background workers that scan, resize or convert a file after upload, started by an event.
Multipart upload
Splitting a big file into chunks that are sent and confirmed one by one, so a failed upload can resume.
CDN for media
Edge servers cache photos and videos near viewers, so storage serves only the misses.