A Deep Dive Into Neon’s Instant PITR
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.
Related posts
- 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.
- Deep dive into Neon storage engine
Neon hardMaster
Neon's storage engine separates Postgres compute from storage and serves pages through GetPage@LSN, reconstructing any page as of any log sequence number from immutable layer files. WAL streams from Postgres to three Paxos-backed safekeepers, then to pageservers that buffer about 1GB of WAL before writing delta layers, building image layers in the background and uploading everything to S3 or GCS. The design borrows from LSM trees but keeps long-lived history, which enables point-in-time restore, copy-on-write branching and fast serverless cold starts without traditional backups or WAL archiving. Compaction and garbage collection bound read cost and retained history, and cold key ranges settle into image layers only.
- 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.
- Inside branch-based restores in Lakebase Postgres
Neon mediumAdept
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.
- Architecture decisions in Neon
Neon mediumAdept
Neon built serverless Postgres by separating storage from compute without forking Postgres. Postgres streams WAL over the network to a separate WAL service of safekeeper nodes, which use consensus for durability and to prevent split-brain. Multi-tenant pageservers rebuild any page version on request. All historical page versions are kept in immutable, LSM-inspired files that are compressed and offloaded to object storage like S3, which replaces traditional backups and WAL archives and makes point-in-time recovery and branching cheap.