---
title: "Point In Time Recovery Under the Hood in Serverless Postgres"
description: "Neon implements point-in-time recovery by treating Postgres as its WAL."
url: "https://swe.quest/articles/point-in-time-recovery-under-the-hood-in-serverless-postgres-81b0a26592d229ce"
canonical: "https://neon.com/blog/point-in-time-recovery-in-postgres"
source: "Neon"
published: "2024-02-22"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 7
tags: ["postgres","storage-engines","serverless","replication"]
---

# Point In Time Recovery Under the Hood in Serverless Postgres

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-02-22, 7 min read, Deep dive. Original: [https://neon.com/blog/point-in-time-recovery-in-postgres](https://neon.com/blog/point-in-time-recovery-in-postgres)

## Summary

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.

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)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)

## Prerequisites

- Postgres WAL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- database backups ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

Neon, Point-In-Time Recovery, WAL, Pageserver, Safekeepers, GetPage@LSN, Barman, Time Travel Assist

## Related posts

- [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.
- [Architecture decisions in Neon](https://swe.quest/articles/architecture-decisions-in-neon-01182afd96537274.md): Neon · 2022-07-08 · Medium · 9 min read · PostgreSQL, Storage engines, System design, Serverless, Replication
  Neon built serverless Postgres by separating storage from compute without forking Postgres.
- [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.
- [Deep dive into Neon storage engine](https://swe.quest/articles/deep-dive-into-neon-storage-engine-efc0ffc53406f34d.md): Neon · 2023-03-30 · Hard · 7 min read · Storage engines, PostgreSQL, Distributed databases, Serverless, Replication
  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.
- [Using Neon branching for instant Point in time recovery](https://swe.quest/articles/using-neon-branching-for-instant-point-in-time-recovery-9f84c3c887a11e14.md): Neon · 2023-07-28 · Medium · 4 min read · PostgreSQL, Serverless, TypeScript
  Neon's copy-on-write branching can restore a Postgres database to an earlier point in time by creating a branch from a timestamp or LSN within the retained WAL history window (seven days by default).

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)
