---
title: "Inside branch-based restores in Lakebase Postgres"
description: "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."
url: "https://swe.quest/articles/inside-branch-based-restores-in-lakebase-postgres-fb20eff343886385"
canonical: "https://neon.com/blog/inside-branch-based-restores-in-lakebase-postgres"
source: "Neon"
published: "2026-09-28"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 8
tags: ["postgres","storage-engines","databases","ai-agents"]
---

# Inside branch-based restores in Lakebase Postgres

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-09-28, 8 min read, Deep dive. Original: [https://neon.com/blog/inside-branch-based-restores-in-lakebase-postgres](https://neon.com/blog/inside-branch-based-restores-in-lakebase-postgres)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)

## Prerequisites

- Postgres WAL ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- point-in-time recovery
- snapshot backups

## Keywords

Lakebase, Neon, PostgreSQL, WAL, pageserver, safekeepers, Amazon RDS, S3

## Related posts

- [Announcing Point-in-Time Restore](https://swe.quest/articles/announcing-point-in-time-restore-fde22da262d059a9.md): Neon · 2024-02-20 · Medium · 5 min read · PostgreSQL, Serverless
  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.
- [WAL + S3: Lakebase storage for the era of agents](https://swe.quest/articles/wal-s3-lakebase-storage-for-the-era-of-agents-3f04922da0e40ff3.md): Neon · 2026-08-24 · Hard · 15 min read · PostgreSQL, Storage engines, Storage systems, Data structures, Replication
  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.
- [A Deep Dive Into Neon’s Instant PITR](https://swe.quest/articles/a-deep-dive-into-neon-s-instant-pitr-6efa2ca3d55740a4.md): Neon · 2025-03-26 · Medium · 6 min read · PostgreSQL, Storage engines, Databases
  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.
- [Point In Time Recovery Under the Hood in Serverless Postgres](https://swe.quest/articles/point-in-time-recovery-under-the-hood-in-serverless-postgres-81b0a26592d229ce.md): Neon · 2024-02-22 · Medium · 7 min read · PostgreSQL, Storage engines, Serverless, Replication
  Neon implements point-in-time recovery by treating Postgres as its WAL.
- [I Dropped a Table in Production—Now What?](https://swe.quest/articles/i-dropped-a-table-in-production-now-what-e098e81a35749033.md): Neon · 2025-02-18 · Medium · 7 min read · PostgreSQL, Databases, Incidents & postmortems
  Neon's instant point-in-time recovery creates a new copy-on-write branch at a moment just before a dropped table.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
