A Lakebase Postgres branch of a 5 TB database took about 5 seconds to create in recent benchmarks. The tests grew a single database from 22 GB to 5 TB and timed branch creation at each step, giving a concrete answer to how quickly a very large Postgres instance can be cloned or restored.
The result matters for anyone who worries about backups, point-in-time recovery or giving AI agents a safe sandbox to work against production-sized data.
How a Lakebase Postgres branch works
Lakebase Postgres, available on Databricks and Neon, calls its clones branches, as in git. Each branch is a separate Postgres database showing the parent’s state at a chosen moment, reachable on its own host.
Creating a branch copies no data. The system keeps compute apart from storage and records every page’s history as write-ahead log. A branch starts a fresh timeline at one WAL position (an LSN) and reads the pages exactly as the parent had them then. Since Postgres stores its catalog alongside the data, the schema comes along too.
From then on it works copy-on-write: untouched pages stay shared, and the branch stores only what it changes. Everything persistent carries over, including tables, indexes, sequences, roles, grants, extensions and settings. Open connections and sessions do not, because the branch boots its own compute.
How the test was run
The author set up one Lakebase project on Databricks and grew it in six steps to 5 TB. The data was synthetic, a wide table of a bigint id plus 100 double precision columns (about 935 bytes a row), loaded in roughly 200 GB shards. The database ran Postgres 17 and autoscaled between 1 and 8 CU. The client was roughly 60 ms away from the region. Every size got 12 branch creations, with the clock running from the API request until the operation reported completion.
Branching from the past
A branch can also start from an earlier timestamp or LSN within the retained history. The author tried that at 1, 2 and 5 TB, going back from about an hour to the oldest point on offer, 5 to 10 hours ago.
- At 5.02 TB, the median was 4.26 seconds when branching from a timestamp and 4.42 seconds from an LSN, about the same as branching from the present.
- For correctness, the author inserted numbered marker rows around each target time. Every branch contained exactly the markers written before its point. At 2 TB, a branch at 21:18:30.000 showed marker 5 but not marker 6, written at 21:18:30.545.
- Average page fetches during lookups took 1.34 to 1.51 ms regardless of age or size.
One wrinkle: on the 5 TB parent, the first branch at a point 5 to 10 hours back saw a few page fetches of 1 to 10 seconds. Later branches at that point did not. The author suspects old history is pulled from object storage on first use.
Cost to the parent and to storage
To measure the effect on the parent, the author kept a write workload running while creating and deleting a branch every 20 seconds for five minutes, with two minutes of the same load on either side. A light workload of about 130 small transactions per second and a heavy one of about 43,000 inserted rows per second showed unchanged throughput and p99 latency before, during and after branching at every size.
A fresh branch owns only about 166 KB of WAL after creation and first connection, at any size. Updating rows adds WAL in proportion to the change. The test update was contiguous, covering the first 1% of ids in each table, so scattered updates that touch more pages per row would cost more.
The Friday afternoon scenario
The author pictures a bad Friday. At 2 PM, logins start failing because a rogue agent dropped the accounts table in production. One command branches the database as of 1:59 PM, and about 5 seconds later a complete copy is ready to swap in or to pull data from. The author says restoring 4 TB at other providers would take hours, though that comparison was not benchmarked here.
Trying it yourself
Lakebase Postgres is part of Databricks Free Edition, which includes one project per account with scale-to-zero compute. The Databricks CLI can create a project, a branch from now with a time-to-live, or a branch from a past timestamp. Each branch gets its own compute and hostname, and you connect with psql using a generated credential. On Neon, branching works the same way. The Free plan needs no credit card and keeps up to 6 hours, or 1 GB of changes, of history for point-in-time branches.
These are one author’s measurements on synthetic data, so production results will vary with workload and update patterns.
Source: PgCraftsman