---
title: "Deep dive into Neon storage engine"
description: "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."
url: "https://swe.quest/articles/deep-dive-into-neon-storage-engine-efc0ffc53406f34d"
canonical: "https://neon.com/blog/get-page-at-lsn"
source: "Neon"
published: "2023-03-30"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 7
tags: ["storage-engines","postgres","distributed-databases","serverless","replication"]
---

# Deep dive into Neon storage engine

A post on [Neon](https://swe.quest/sources/neon.md), published 2023-03-30, 7 min read, Deep dive. Original: [https://neon.com/blog/get-page-at-lsn](https://neon.com/blog/get-page-at-lsn)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)

## Prerequisites

- PostgreSQL write-ahead log ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- LSM trees ([easy posts on Storage engines](https://swe.quest/tags/storage-engines.md?difficulty=easy))
- Object storage basics ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))

## Keywords

Neon, GetPage@LSN, PostgreSQL, pageserver, safekeeper, Amazon S3, pgbench

## Related posts

- [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.
- [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.
- [What you get when you think of Postgres storage as a transaction journal](https://swe.quest/articles/what-you-get-when-you-think-of-postgres-storage-as-a-transaction-journal-a74912c90f281399.md): Neon · 2024-05-01 · Medium · 9 min read · PostgreSQL, Storage engines, Replication, Distributed databases
  Neon treats Postgres storage as a transaction journal: the write-ahead log becomes the source of truth instead of a recovery aid.
- [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.

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)
