Skip to content
Neon Blog· Carlota Soto·· 8d ago

Rethinking Read Replicas for the Lakebase Architecture

Rethinking read replicas for the lakebase architecture

Key Takeaway

Neon argues that read replicas in monolithic managed Postgres such as Amazon RDS are physical clones that take minutes to hours to provision, duplicate storage, and run 24/7 without autoscaling.

Why It Matters

Keeping durable state in shared storage lets read replicas scale compute independently and offload ad hoc reporting and bulk exports from the primary.

Technical Breakdown · Distilled from the original source

How replicas attach to shared storage

  • The control plane starts a read-only compute node on the same branch and initializes it from a slim base backup served by the pageserver. It does not need to populate a separate data volume.
  • The replica streams WAL from safekeepers rather than asking the primary to send a separate stream. It reads pages from the same pageservers at its own position in the log. A pageserver can reconstruct a page at a specified log position via GetPage@LSN.
  • The replica applies WAL only to cached pages and fetches uncached pages from the pageserver. Shared buffers and local NVMe are caches, not durable storage.

Elastic scaling and read/write routing

  • Each replica has its own autoscaling range. The system adjusts compute in place based on CPU, memory, and working set without provisioning a new instance.
  • By default, a replica suspends after five idle minutes and wakes on the next query. Storage keeps ingesting WAL during suspension, so the replica can catch up almost immediately without replaying a backlog on wake.
  • The article covers read scaling, not high-availability standbys. A nightly export can read from a replica and send its final status write to the primary, keeping export queries from competing with application requests for the primary’s CPU and cache.
Source: Neon Blog· neon.com

PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.

Read Official Source

Related PostgreSQL Reference