SysDesignAtlas

Databases on Object Storage

Why a new generation of databases, queues and search engines keeps no data on local disk at all — what made it possible, how a write survives 50 ms object-store latency, and how compare-and-swap on a file replaces a consensus cluster.

HLDHard11 min readstorageobject-storages3architecture
Confidence

#A different place to put the data

The classic database design keeps data on disks attached to its own machines and replicates it to other machines for durability. Over the last few years a growing set of systems has done something that would have sounded reckless a decade ago: keep the durable copy only in object storage — S3 or its equivalents — and treat local disks and memory as nothing more than a cache.

   CLASSIC (shared-nothing)              OBJECT-STORAGE NATIVE

   node 1  [ data on local disk ]        compute 1  [ cache ]  ┐
   node 2  [ replica on local disk ]     compute 2  [ cache ]  ├─► object store
   node 3  [ replica on local disk ]     compute 3  [ cache ]  ┘   (the only
                                                                   durable copy)
   durability = replicate between        durability = the object store's
   your own machines                     own replication across zones
   lose a node → re-copy its data        lose a node → start another;
                                         nothing to re-copy

"Shared-nothing" is the classic layout on the left: each node owns its own disks and shares no storage with the others, so any copying between nodes is the database's own job.

The examples now span most kinds of data system:

SystemWhat it isThe object-storage idea
Snowflake, BigQueryData warehousesThe pioneers: storage separated from compute, which scales independently
Iceberg, Delta LakeTable formatsTables are files plus metadata, committed atomically
NeonPostgresWAL to a small quorum, pages to object storage
WarpStream, Kafka diskless topicsMessage logsBrokers keep nothing; batches go straight to object storage
turbopuffer, LanceDBSearch and vector databasesIndexes in object storage, hot data cached on NVMe
SlateDBEmbedded key-value storeAn LSM tree whose files live only in object storage

#Why now: three changes

1. Strong consistency (2020). S3 became strongly consistent for reads after writes in December 2020. Before that, a reader might not see an object it had just written, which made building a database on it a minefield.

2. Compare-and-swap on objects (2024). S3 added conditional writes: in August 2024, "create this object only if it doesn't already exist" (If-None-Match); in November 2024, "replace this object only if it's still the version I read" (If-Match on the ETag — a fingerprint S3 returns with every object, which changes whenever the object does). Google Cloud Storage and Azure had offered similar preconditions for longer. That single primitive is enough to coordinate writers without a separate consensus cluster — more below.

3. The economics of cloud networking. In the cloud, copying data between availability zones is billed per gigabyte, in both directions. A classic replicated database or Kafka cluster copies every byte to two other zones — often its largest cost. Object storage replicates across zones internally, with no per-gigabyte transfer charge for writing to it from within the region. Moving replication into the object store removes that line from the bill.

#The latency problem, and the standard answer

Object storage is durable, cheap and effectively unlimited. It is not fast:

   Local NVMe write                 ~0.02-0.1 ms
   Write to a replica in another    ~1-2 ms
     availability zone
   S3 Standard PUT                  ~20-100 ms typical, more for the slowest
   S3 Express One Zone              single-digit ms, one zone only

A database that waited 50 ms per write would be useless for most workloads. The answer, in every system above, is the same one databases have always used for slow disks: batch.

The trade is plain: throughput and cost improve, per-write latency gets worse. Systems then claw some latency back in a few standard ways:

  • A low-latency write-ahead log in front. Neon writes its WAL to a small Paxos group of "safekeepers" — three or so servers that must agree, via the Paxos consensus protocol, before a write counts — for fast commits, and moves pages to object storage in the background. Others write the log to S3 Express One Zone, or to replicated local disks, and flush to standard object storage later.
  • Acknowledge on the fast tier, upload later — and be explicit about what survives losing that tier. If the fast tier is S3 Express One Zone, an acknowledged write that hasn't reached standard S3 yet is lost if that one zone goes down.
  • Choose per topic or table. Kafka's diskless topics are opt-in: low-latency topics keep classic replication, high-volume logs that tolerate a second of delay go diskless.

#Reads: caching is the whole performance story

A read that goes all the way to object storage costs tens of milliseconds and a request fee. So these systems cache aggressively in layers:

   memory       hot data           microseconds
   local NVMe   warm data          ~0.1 ms     (far cheaper per GB than
                                                RAM; fast for big reads)
   object store everything else    tens of ms

Routing matters as much as the cache. turbopuffer, for example, sends queries for the same namespace (one customer's index, say) to the same query node so that node's NVMe cache stays warm — the same cache-affinity idea used for LLM prefix caches. A cold read of a rarely touched dataset is slow; a warm read is fast. That's the bet: most data is cold most of the time, and paying object-storage prices for it while caching the hot part beats paying replicated-disk prices for all of it.

#Coordination without a consensus cluster

The interesting systems problem. Many writers can append immutable files safely — names are unique, nothing is overwritten. The hard part is the one mutable thing every database has: the pointer to its current state (the manifest, the table metadata, the list of live files). Two writers updating it at once would corrupt the database.

Classically you'd run a consensus group (ZooKeeper, etcd) to decide who the writer is. With conditional writes, the object store itself can do it. The trick is a writer epoch: a number stored in the manifest that goes up by one every time a new writer takes over. Whoever successfully wrote the latest epoch is the writer.

   THE MANIFEST HOLDS: list of live data files + writer epoch

   Writer B starts:
     read manifest            → epoch 7, ETag "e7"
     write manifest, epoch 8,
       IF-MATCH "e7"          → succeeds: B is now the writer

   Old writer A (paused, then wakes up) tries to commit:
     write manifest, epoch 7 + its new files,
       IF-MATCH "e7"          → FAILS: the manifest has changed
                                A learns it was fenced off and stops

That's a fencing token implemented as a compare-and-swap on a file.

SlateDB uses exactly this pattern. Each new writer bumps the epoch in the manifest with an If-Match write. Its write-ahead-log objects are created with If-None-Match ("only if this name doesn't exist yet"), using names tied to that epoch. Together these stop a "zombie" writer — an old writer that was cut off by a network partition or a long pause and still thinks it's in charge — from slipping stale data in after a new writer has taken over.

Table formats work the same way. An Iceberg or Delta commit is an atomic swap of the pointer to the current metadata — via a catalog or, increasingly, via a conditional write on the object store itself. Many writers prepare new files in parallel; only the pointer swap must be serialised, and the loser of a race retries its commit against the new state.

#When it fits, and when it doesn't

Good fitPoor fit
Analytics, logs, metrics, search over large mostly-cold dataTransactions needing single-digit-ms commits at high rates
Many tenants, each queried occasionallySmall, hot datasets that fit comfortably on one machine
Elastic compute — scale to zero when idleWorkloads dominated by tiny random writes
Avoiding cross-zone replication costsSingle-zone deployments where replication is cheap anyway
Simple operations — losing a node loses no dataTeams that can't tolerate cold-read latency spikes

#Check yourself

What does "object-storage native" mean for a database?Show answer
The only durable copy lives in object storage such as S3; local disks and memory are caches. Losing a node loses no data, and compute scales separately from storage.
Which three changes made databases on object storage practical?Show answer
S3 strong read-after-write consistency (2020), conditional writes — If-None-Match (August 2024) and If-Match (November 2024) — and cloud pricing that charges per gigabyte for cross-zone replication but not for writing to object storage.
How do these systems cope with 20–100 ms object-store writes?Show answer
Batching — many records per object, like group commit — which slashes request cost and shares one slow write among many, often with a fast write-ahead log (a Paxos quorum, S3 Express or replicated disks) in front.
Why is batching mandatory in money as well as latency?Show answer
10,000 one-record PUTs a second is ~864 million requests a day (~$4,300); batching every 250 ms is ~346,000 (~$1.70). Requests, not storage, dominate the naive design.
How do object-storage systems make reads fast?Show answer
Layered caches — memory, then local NVMe — plus routing the same dataset to the same node so its cache stays warm. Cold reads still pay object-store latency.
How can a conditional write replace a consensus cluster?Show answer
Keep one mutable manifest holding a writer epoch. A new writer bumps the epoch with If-Match on the ETag it read; a stale writer's later If-Match fails, fencing it off.
What is the underlying pattern?Show answer
Immutable data files written freely in parallel, plus one small mutable pointer updated by compare-and-swap — the same shape as copy-on-write, MVCC snapshots and Git commits.
When is this architecture a poor fit?Show answer
Low-latency transactional commits, small hot datasets, workloads of tiny random writes, single-zone deployments, and anywhere request costs or cold-read spikes would dominate.

#What to carry forward

  • Object storage can be the database's only durable copy; local storage becomes a cache.
  • Strong consistency, conditional writes and cross-zone pricing made the shift practical.
  • Batch every write — it's what makes latency tolerable and request costs sane.
  • Immutable files plus one compare-and-swapped pointer replaces a consensus cluster.
  • Great for large, mostly cold, elastic workloads; estimate request costs before choosing it.
00:00
/ 11m