Disaggregated & Serverless Databases
Separate stateless SQL compute from log-structured page servers over object storage for instant branching, scale-to-zero, and lower WAL write amplification.
In this lesson (4 bite-sized sections)
The log is the database
In a traditional primary database backed by mirrored block volumes, modifying a single row forces entire 8 KB or 16 KB dirty pages, journal blocks, and checkpoint flushes across availability zones. Scaling CPU or adding a read replica also means duplicating terabytes of storage. Cloud-native engines such as Amazon Aurora, Google Cloud AlloyDB, Neon, and Turso break that coupling by separating stateless SQL compute from a distributed, log-structured storage tier.
Page servers, object storage, and copy-on-write branching
Once compute ships only write-ahead log records to a durable quorum (Aurora storage nodes or Neon Safekeepers), the storage tier handles durability and page assembly asynchronously. Log-structured page servers ingest the WAL stream, materialize any requested page version on demand, compact older segments, and flush immutable layer files to S3 or GCS for eleven-nines durability at object-storage prices.
Disaggregated serverless SQL architecture: an architecture diagram of 5 components and 5 connections. Full description follows.
- Primary SQL Compute (Stateless): service.
- Read Replica / Branch Compute: service.
- WAL Quorum / Safekeepers: queue or log.
- Log-Structured Page Servers: database.
- S3 / GCS Layer Files: external system.
- Primary SQL Compute (Stateless) calls synchronously WAL Quorum / Safekeepers (WAL append).
- WAL Quorum / Safekeepers sends asynchronously to Log-Structured Page Servers (WAL stream).
- Primary SQL Compute (Stateless) calls synchronously Log-Structured Page Servers (GetPage@LSN).
- Read Replica / Branch Compute calls synchronously Log-Structured Page Servers (GetPage@LSN).
- Log-Structured Page Servers sends asynchronously to S3 / GCS Layer Files (Cold layers).
Because page servers index data by Log Sequence Number (LSN), creating a database branch in Neon or Turso requires no bulk data copy. A branch simply records a metadata pointer to a parent LSN and uses copy-on-write: reads walk back to parent layers while new writes allocate only modified delta pages. Ephemeral CI previews, point-in-time recovery, and instant read replicas all attach to shared storage in seconds instead of hours. In Aurora and AlloyDB, read replicas skip physical log replay on disk and instead invalidate stale buffer-pool pages directly from the primary's log stream, keeping replica lag in the tens of milliseconds even under heavy write bursts.
Scale-to-zero and cold-start tradeoffs
Stateless compute unlocks autoscaling and scale-to-zero. When a database sits idle for a few minutes, the control plane suspends the compute VM and stops billing for CPU and RAM. For multi-tenant SaaS fleets with tens of thousands of mostly idle databases, suspending idle compute eliminates the idle-fleet tax. In Turso (libSQL), embedded local replicas pair with this same log separation so edge read paths serve local microsecond SQLite reads while syncing writes back to the primary log.
The price appears on the first query after suspension. Booting the compute container takes a few hundred milliseconds, and the fresh process starts with an empty RAM buffer pool. Until hot B-tree index pages warm back up, cache misses fetch pages over RPC from page servers. Production platforms soften that cliff with connection poolers that hold client sockets during wake-up, local NVMe read caches (such as Neon's Local File Cache), and configurable suspension timers for latency-sensitive tenants.
When coupled local SSDs still win
Disaggregation is a trade-off, not a universal win. Every cache miss crosses the network to a page server, adding sub-millisecond to low-millisecond latency compared to local NVMe, and usage-based I/O billing can spike under unindexed analytical scans. For a steady 24/7 OLTP core with flat high traffic and strict sub-millisecond p99 read budgets, a conventional Postgres primary on local NVMe stays simpler and faster. Choose disaggregated serverless storage when bursty load, dense multi-tenant fleets, rapid read-replica scaling, or instant copy-on-write branching drives your architecture.
Sources: Neon Architecture Overview · AWS Aurora Storage Architecture · Google Cloud AlloyDB Overview
Apply
Your turn
The task this lesson builds to.
Evaluate a disaggregated serverless Postgres stack for a B2B SaaS platform hosting 25,000 tenant databases where 90 percent sit idle overnight and CI opens 400 preview branches per day. Specify compute scaling, storage layering, branching, and cold-start mitigation.
Think about
- Why does database-per-tenant become affordable when compute scales to zero?
- How does copy-on-write branching avoid copying multi-gigabyte databases for every pull request?
- Which tenants should disable scale-to-zero or keep warm caches to protect p99 latency?
Draft your design answer here Save your draft, compare against the model answer, and track progress.
Practice
Make it stick
A second problem on the same idea, so it survives past today.
Compare Aurora or Neon style disaggregated storage against local-NVMe Postgres for a 24/7 high-frequency order matching engine targeting sub-millisecond p99 reads, and justify which architecture fits.
Think about
- Where does the extra network hop hurt when working sets experience random page misses?
- Does scale-to-zero save any money on a steady 24/7 workload?
- When does the operational simplicity of coupled local NVMe outweigh disaggregated features?
Draft your design answer here Save your draft, compare against the model answer, and track progress.