Inside branch-based restores in Lakebase Postgres
Lakebase Postgres turns point-in-time restore into a metadata operation: creating a branch at a timestamp that points at existing immutable page history, rather than provisioning an instance, hydrating a snapshot from S3 and replaying WAL. Compute is decoupled from storage, which is split into safekeepers (quorum WAL durability), a pageserver that reconstructs any page at any LSN, and object storage holding immutable image and delta layers. As a result, restore time stays near-instant whether the database is 10 GB or 100 TB, past states can be queried before committing to a restore, and the operation is cheap enough for agent platforms to build undo and checkpoint features on.
Related posts
- Announcing Point-in-Time Restore
Neon mediumAdept
Neon's Branch Restore feature, now in the Neon Console, restores a Postgres branch to any LSN or timestamp within a configurable history retention window of up to 30 days. This is possible because Neon's separated storage and compute retain WAL history. Time Travel Assist lets you query the database as it was at a chosen point before committing, so you can pinpoint when data loss happened. Restores take a few seconds and briefly drop connections, much like a cold start. The post contrasts this with self-managed approaches: pg_dump offers no point-in-time recovery, while pg_basebackup with WAL archiving, pgBackRest or Barman can do it but cost operational effort.
- WAL + S3: Lakebase storage for the era of agents
Neon hardMaster
Lakebase Postgres (Neon's architecture) treats the Postgres write-ahead log as the source of truth and data pages as a derived cache, splitting the system into stateless compute running unmodified Postgres and a storage layer of Paxos-replicated safekeepers, pageservers, and S3. Commits are acknowledged once a quorum of safekeepers has the WAL, while pageservers asynchronously materialize immutable image and delta layers into object storage and serve GetPage@LSN requests by replaying WAL onto the nearest image. Finding the right layer among tens of millions uses a persistent binary search tree with path copying, so historical reads at any LSN cost the same as latest reads. Because queries hit RAM, local NVMe, then the pageserver, and never S3 directly, the design avoids object-storage latency while making branching, instant point-in-time restore, and time-travel queries pointer operations whose cost does not depend on database size.
- A Deep Dive Into Neon’s Instant PITR
Neon mediumAdept
Neon's point-in-time restore is instant because its storage is copy-on-write: compute nodes stream WAL to Paxos-replicated safekeepers, and pageservers reconstruct any page at any past LSN from image and delta layers kept in object storage. A restore maps the requested timestamp to an LSN and creates a new branch that references existing layers through GetPage@LSN, so no data is copied. That makes restores take under a second regardless of database size, compared with RDS-style restores that load a snapshot into a new instance and replay WAL, which can take hours for multi-TB databases.
- Point In Time Recovery Under the Hood in Serverless Postgres
Neon mediumAdept
Neon implements point-in-time recovery by treating Postgres as its WAL. WAL is streamed to Paxos-backed Safekeepers, then to multi-tenant Pageservers that build immutable image and delta layers keyed by key range and LSN. The post contrasts this with traditional Postgres PITR, which needs base backups, WAL archiving, tools like Barman and a standby server. Neon's GetPage@LSN instead rebuilds any page at any LSN on demand. Time Travel Assist uses this through ephemeral copy-on-write branches with a 10-second TTL, so you can query a past state before restoring.
- I Dropped a Table in Production—Now What?
Neon mediumAdept
Neon's instant point-in-time recovery creates a new copy-on-write branch at a moment just before a dropped table. That branch is available in about one second regardless of database size, and production keeps running while it is created. Two recovery routes follow from this. One is to pg_dump the table out of the recovered branch and import it into production, which keeps all data written after the drop. The other is to use Branch Restore to swap production onto the recovered branch under the same connection string, which discards post-drop writes. RDS, by contrast, restores a snapshot to a new instance and replays WAL, which can take hours for multi-terabyte databases.