open atlas
↑ Back to track
System Design Foundations SD · 07 · 04

Storage choices: multiple-choice review

Multiple-choice synthesis across the storage unit: SQL vs NoSQL and the ACID/BASE trade, access-pattern-first design, blobs vs object storage with presigned URLs, durability vs availability, specialized stores, and the dual-write problem.

SD Senior ◷ 13 min
Level
FoundationsJuniorMiddleSenior

Six questions that cut across the whole unit. Each is a decision you make at a design review or on a whiteboard — which store fits a workload, where the bytes live, what consistency you’re trading, and how two stores stay in sync — not a definition to recite.

Confirm you can place a workload on the SQL/NoSQL axis by the consistency it needs, spot when access-pattern-first design will bite, keep bytes out of the database, separate durability from availability, pick a specialized store on a measured limit, and avoid the silent dual-write divergence.

Quiz

A feature must atomically move money between two rows with no intermediate state visible to concurrent transactions. Which property is non-negotiable, and what store class typically provides it?

Quiz

You modeled a key-value table around 'get item by id.' Six months later product needs 'list all items for a customer, newest first,' and customer isn't in the key. What does the access-pattern-first design predict?

Quiz

A video app stores multi-GB uploads as BYTEA in Postgres 'to keep bytes and metadata in one transaction.' What breaks at scale, and what's the fix?

Quiz

'S3 is eleven-nines durable, so our images survive any outage and we don't need cross-region replication.' What's the precise correction?

Quiz

A search box runs `WHERE description LIKE '%word%'` on a 3M-row table with a B-tree index on description, and it times out under load. What's the verdict and the right tool?

Quiz

You write an order to Postgres, then best-effort index it in Elasticsearch (log and ignore failures) to keep the request fast. Months later search is missing orders unpredictably. Root cause and fix?

Recall before you leave
  1. 01
    Why is 'eleven nines durable' not 'always available,' and what closes the gap?
  2. 02
    How do you keep a search index consistent with the database without a dual write?
Recap

The through-line is that storage choice is matching a workload to the guarantees a store actually provides. Money needs ACID atomicity and isolation (relational), not BASE — convergence “eventually” is a window you can’t allow. Access-pattern-first NoSQL design is fast for planned patterns and brutal for unplanned ones, so a new query with no matching key degrades to a scan. Large bytes never go in the database (ballooning backups, poisoned buffer cache, WAL bloat, pool starvation) — keep metadata in the DB, bytes in object storage, served by presigned URLs. Durability is not availability: eleven nines means you won’t lose bytes, not that a region can’t go dark, which is what cross-region replication is for. A specialized store (time-series, search) earns its place on a measured limit and is treated as a derived index, with the dual-write problem solved by deriving that index from one authoritative commit via CDC or a transactional outbox — never two independent writes.

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.