Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read How-to easyNovice

Understanding Neon’s object hierarchy

Neon organizes serverless Postgres into projects, branches and compute endpoints, built on a separation of storage and compute that avoids sizing a database upfront. A project is a container per application holding a Postgres cluster (default database "neondb"); branches are copy-on-write, isolated copies of data from the current or a past point in time, with the default cluster represented by the "main" branch. Each branch is reached through a compute endpoint that can be fixed-size or autoscale between a minimum and maximum, letting you cap worst-case spend; at time of writing each branch supports only one endpoint, with read replicas planned to allow more.

Related posts

  • Practical Guide to Database Branching

    Neon mediumAdept

    Neon's copy-on-write storage makes Postgres database branches instant and cheap: each branch shares the parent's base data, gets its own autoscaling compute that scales to zero, and can be created from any point within the history retention window. Recommended workflows include a protected production branch whose child branches get new credentials automatically, staging and per-developer or per-pull-request branches that are periodically reset from the parent, and anonymized branches (beta) as the parent when data contains PII. Point-in-time branches support recovering dropped tables, debugging bad migrations and audits without rolling back production. Ephemeral branches should be deleted promptly, and the restore window (6 hours on the Free plan, 1 day on paid plans) can be shortened to cut storage costs.

  • SELECT ’Hello, World’

    Neon easyNovice

    Neon is a serverless Postgres service built on separated storage and compute, launching behind a waitlist. Each user gets a containerized Postgres compute node, while data lives in a multi-tenant Rust storage layer: Safekeepers run a consensus protocol and, together with S3, form the system of record, and Pageservers serve pages with low latency as disposable scratch space. Avoiding EBS in favour of local disk for hot data and S3 for cold data cuts the cost of triple-replicated storage and compute. Stateless compute also enables scale-to-zero, roughly 3-second provisioning, and copy-on-write database branching for CI/CD workflows, all released under Apache 2.0.

  • Building Neon Object Storage

    Neon easyNovice

    Neon Object Storage is an S3-compatible object store whose buckets and objects branch together with a Neon Postgres database under one shared branch_id, so a child branch inherits files at the fork point with copy-on-write isolation. Postgres branches via the pageserver's page-level copy-on-write. Object Storage uses its own lineage-and-versioning scheme: each branch stores an ordered lineage back to root, every write adds a versioned row, lookups walk the lineage, and deletes on a child write a tombstone version without touching the parent. Branch creation is a single write regardless of data size, and storage cost only grows as branches diverge. Access is through the standard S3 wire protocol with Neon credentials, with bucket visibility managed in Neon rather than S3 ACLs and provisioning declared in neon.ts.

  • Neon Functions: backend logic next to your data

    Neon mediumAdept

    Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE_URL and other Neon backend credentials injected automatically. Running next to the data removes the cross-network hop per query and lets a function keep a pg Pool open across requests, so agents can stream for minutes and WebSockets or SSE can fan out via Postgres LISTEN/NOTIFY. Functions branch with the database: each child branch gets its own function copy and URL, and deleting the branch deletes it. They are declared in neon.ts, Hono is the recommended framework, and the pg Pool is recommended over the serverless driver; functions are not for frontend hosting or background jobs, and cron and event triggers are planned.

  • Using Neon branching for instant Point in time recovery

    Neon mediumAdept

    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). Creating the branch from the console gives you a new compute endpoint and so a new connection string. To keep the existing connection string, a TypeScript script using the Neon API client creates an endpoint-less branch at the target timestamp, reassigns the existing compute endpoint to it, and sets it as the primary branch. Afterward, rename the old branch and delete its data to avoid storage charges.

The quest for software engineering knowledge.

Look:
Layout: