Storing · Chapter 07
Databricks Lakebase: managed Postgres with branching
Reviewed by TechFabric engineers. How we write this guide →
Lakebase is Databricks' fully managed PostgreSQL service. It runs real Postgres (versions 16, 17 and 18, with 17 the default) on compute that autoscales and can scale to zero, over versioned copy-on-write storage, so a full copy of a database is a branch made in seconds. It sits inside the Databricks account, under the same Unity Catalog permissions as the lakehouse, with managed sync of tables in both directions.
A developer on one of our product teams asked for a copy of production so he could reproduce a bug. On most stacks that request starts a conversation about disk, about how stale the snapshot can be, and about who pays for the extra instance until somebody remembers to tear it down. On Lakebase it was a branch, and he had it before the conversation finished (Preetham's write-up). We run Lakebase as the operational database under several applications we build, and that one habit, a copy of production whenever someone needs one, is the reason it's our default Postgres for a team already on Databricks.
We'd expect the first objection from any team to be that it's just Postgres and they already have Postgres. Wire protocol, backups, replicas, high availability and point-in-time restore do tick the same boxes as RDS, Azure Database for PostgreSQL or Cloud SQL. The boxes say nothing about how often people copy a database, test a migration against real rows or restore one at 4pm on a Friday, and separated storage changes all three.
The short version
Lakebase is Postgres, so your application code and your tools don't change. Its storage is separate from its compute and versioned, which means a full copy of a production database is a branch that takes seconds and bills only for what changes on it. Engineers get their own copy of real data, every pull request can test a migration against it, and a bad UPDATE is repaired from a branch taken at the minute before it ran. It also sits under the same Unity Catalog permissions as your analytics, with managed sync in both directions. Give every branch an expiry, decide the history window on purpose, and it stays cheap.
Why a branch costs almost nothing #
In a conventional managed Postgres the disk belongs to the instance. Copying the database means copying bytes, a restore means writing a backup onto a new disk before anything can query it, and the copy costs a second instance for as long as it lives. Snowflake Postgres has the same shape underneath, a dedicated virtual machine per instance with forks that copy all the data; Databricks Versus Snowflake sets the two side by side.
Lakebase keeps pages in versioned, copy-on-write storage, and compute is something you point at it. A new branch is a pointer to the parent's pages at a moment in time. It shares every page until it writes one, so creating it moves nothing, and recovery is the same operation aimed at a timestamp in the past.
What the Gilbert session measured #
At the first Gilbert Databricks User Group session on 18 September 2026, in our Gilbert office, Preetham Reddy built an application on Lakebase live from a script, and every number on the slides was measured in the room that evening. These are the figures we'd plan around before anything on a datasheet.
Branching. create-branch came back READY in 4.5 seconds with its own read-write endpoint and logical_size_bytes at zero, because its pages are still the parent's. One fingerprint query run against both branches then showed a schema change, a price change and a DELETE that production never saw.
Scale to zero has a price, and it's about 1.3 seconds. The first query against an idle endpoint took 2,979 ms against 1,650 ms warm, and after five idle minutes the endpoint went back to zero on its own. For an internal tool that's fine. For a customer-facing page that's quiet overnight, we'd turn scale-to-zero off on that endpoint so the first visitor of the morning doesn't pay it.
No passwords, and the Data API ran each request as the caller. The project set enable_pg_native_login to false, so a person at psql and an application holding client credentials both arrived as the same one-hour OAuth token and ordinary GRANT decided the rest. Running each Data API request as its caller made GRANT and row-level security the whole authorisation model, with the token exchange as the only server-side code. One policy on demo_app.orders gave three callers three answers: the owner saw every status over psql, the service principal got an empty array for rows it couldn't read, and posting a cancelled order came back 403 with 42501, because a policy that would hide a row won't let you create it either. Responses ran 384 to 542 ms.
How does the Lakebase Data API decide who sees what? #
The Data API is a REST interface over the database that follows PostgREST's conventions, though it's Databricks' own implementation and leaves some PostgREST features out. Every request carries a Databricks OAuth bearer token, and a single authenticator role takes on the caller's identity, so each Databricks user or service principal that calls it needs a matching Postgres role. Enabling it exposes the public schema and nothing else until you grant it.
That's why the Gilbert result above needed no application code for authorisation. A policy of this shape is what does the work, and current_user inside it is the caller's Databricks identity (an email address for a person):
ALTER TABLE public.orders ENABLE ROW LEVEL SECURITY;
-- Callers see and write only their own orders, and can't create one already cancelled
CREATE POLICY orders_own_rows ON public.orders
USING (customer_email = current_user)
WITH CHECK (customer_email = current_user AND status <> 'cancelled');
GRANT SELECT, INSERT ON public.orders TO "analyst@example.com";Row-level security can't be set on a view, so a view the API exposes needs security_invoker = true for the caller's policies to apply through it. And we'd never let the API run as the database owner, which bypasses row-level security entirely.
Recovering from an UPDATE that lost its WHERE #
The same session showed recovery on the mistake everyone has made once (event recap). Branch from source_branch_time set just before the bad statement; it snaps to the last committed write at or before the moment you name, and source_branch_lsn is the exact alternative when you have the log position. The repair is ordinary Postgres, a COPY out of the recovery branch and an UPDATE ... FROM back into production. The recovery branch stays available for the post-mortem until somebody deletes it, and production keeps every write made since, because the repair rewrites only the damaged rows.
Two seams came with it, and both belong in a runbook before the first incident. history_retention_duration was seven days on that project (the restore window can be set from 2 to 30 days, default 7), and past it there's no moment left to branch from, so we'd settle the number with whoever owns the data rather than leave the default by accident. And the repair assumed nothing else was writing, which is true of a demo and won't be true of a production database taking orders, so the runbook needs the step that stops or fences the writers first.
Recovery has ceilings as well. A point-in-time restore creates a new root branch and leaves the original running, and a project allows at most three root branches, so a second incident in a week can mean deleting an old restore first. Manual snapshots are capped at ten per project, are taken on root branches only, and have billed for storage since 1 June 2026; scheduled snapshots, one daily, weekly or monthly schedule per root branch, don't count against the ten (the snapshots and backup schedule APIs are in Beta). We'd spend the manual ten on deliberate restore points before a schema migration or a destructive backfill, each with a TTL of about seven days, and put "delete the restore branch once the repair is verified" in the runbook next to the step that creates it.
The billing rule that keeps branching cheap #
Copy-on-write decides how a branch is stored, and its expiry decides how it's billed. An expiring branch is billed only for the data that changes on it, so changing 1GB on an expiring branch of a 100GB database bills about 1GB. A branch with no expiry is billed at its full size, like an independent database, even when it barely differs from its parent. Expiry is set when the branch is created, as a ttl, an expire_time or no_expiry, and the longest expiry allowed is 30 days from now:
# A pull-request branch that deletes itself after four hours
databricks postgres create-branch projects/my-project pr-123 \
--json '{"spec": {"source_branch": "projects/my-project/branches/production", "ttl": "14400s"}}'
# A shared staging branch somebody has decided to pay for in full
databricks postgres create-branch projects/my-project staging \
--json '{"spec": {"source_branch": "projects/my-project/branches/production", "no_expiry": true}}'So the per-developer pattern needs one rule. Personal branches get an expiry and are recreated on a schedule, and never-expiring branches are kept to the one or two shared ones (development, staging) that someone has decided to pay for. In CI the TTL should be hours, set by the pipeline that creates the branch, because a failed job that never reaches its cleanup step otherwise leaves a full-price copy behind. A project holds up to 500 branches and 20 concurrently active computes, and one branch can be marked protected so nobody deletes or resets it.
How much does Lakebase cost? #
Lakebase bills compute in capacity units (CUs), where one CU is about 2 GB of RAM, and storage by the GB-month. These are the list prices on AWS, Premium tier, US East, read from the Lakebase pricing page on 22 October 2026. Compute is half price under a promotion that runs until 31 January 2027; the storage rates aren't discounted.
| What you pay for | List price | What it covers |
|---|---|---|
| Autoscaling compute | $0.092 per CU-hour | Every CU-hour on a compute that can scale to zero, and usage above the floor on an always-on one |
| Always-on minimum | $0.069 per CU-hour | The floor of a compute whose scale-to-zero has been off for more than 24 hours, high-availability computes included |
| Database storage | $0.345 per GB-month | The data itself |
| Point-in-time restore storage | $0.200 per GB-month | The history behind the restore window |
| Snapshots | $0.090 per GB-month | Manual and scheduled snapshots |
Synced tables add the DBUs of the serverless Lakeflow pipeline that does the syncing, on that product's own rate.
The arithmetic for a small user-facing database: a 0.5 CU floor left on for a 730-hour month is 365 CU-hours, about $25 at the always-on rate (about $12.60 during the promotion), plus $3.45 for 10 GB of data, before history and snapshots. Databricks' sizing write-up, quoted further down, puts the same floor at $31 to $40. Either way, the floor that removes the 1.3-second cold start Gilbert measured costs less than an hour of an engineer's time a month, which is why we'd pay it on anything a customer opens.
Autoscaling runs up to 64 CU, with no more than 16 CU between a compute's minimum and maximum, and scale-to-zero is only available when the maximum is 32 CU or less. Above 64 CU the computes are fixed-size. Tag Lakebase spend with a serverless usage policy at project creation (budget_policy_id in create-project), so it lands in system.billing.usage under the team that owns it; What It Costs has the query.
The same permissions as the analytics, and data both ways #
The second reason we'd choose Lakebase is that the operational database sits in the same Unity Catalog model as the lakehouse, so "who can see this customer's data" has one answer. On RDS or Cloud SQL the analytical copy arrives through DMS, Glue or Datastream, with its own IAM, its own monitoring and a second set of grants that has to be kept in agreement by hand.
At Gilbert both directions were timed. postgres create-catalog took 5.7 seconds to make the database a Unity Catalog catalog that a SQL warehouse reads in place, a synced table in SNAPSHOT mode was online 51 seconds after the call, and application writes reached Delta through the change data feed in 10 to 15 seconds (slides). One seam: REPLICA IDENTITY FULL has to be set before the feed is enabled, because a table without it is skipped and flipping it afterwards isn't reliably picked up. The synced copy also lived in its own lakehouse schema so the feed on demo_app didn't replicate it straight back out.
-- Before starting the Lakebase change data feed on a schema, on every table in it
ALTER TABLE demo_app.orders REPLICA IDENTITY FULL;The two directions are at different release stages. Synced tables, Unity Catalog into Postgres, are generally available; the Lakebase change data feed, Postgres changes into a Delta history table with _pg_change_type and _pg_lsn columns, is in Public Preview. Since 15 October 2026 Lakebase also supports Postgres logical replication in and out, the route for an existing Postgres feeding it or a downstream system reading from it (release notes).
| Synced table mode | What it does | When we'd use it |
|---|---|---|
| Snapshot | Re-copies the whole table each run, up to about 2,000 rows a second per CU | More than about 10% of rows change between runs, or the source has no change data feed |
| Triggered | Applies inserts, updates and deletes incrementally, on demand or on a schedule | Reference data that changes daily or hourly |
| Continuous | Streams changes with a minimum interval of 15 seconds, about 150 rows a second per CU | Features or status an application reads at request time |
Triggered and Continuous need a change data feed on the source table. Each sync holds up to 16 connections against the project's limit, a source table can feed at most 20 synced tables, and Databricks recommends keeping a synced table under 1 TB.
Where we'd use it, and where we wouldn't #
We'd reach for it first where a warehouse handles the write pattern badly and a separate Postgres would mean another estate to secure. Online features at request time are the clearest case: in AutoFabric, our loan platform on Databricks, the voice agents we're building read their online features from a Databricks online feature store that runs on Lakebase. Decision and evidence logs are the second, one row per policy evaluation as in Governed Actions. Application state for data-adjacent tools, such as review queues and approval workflows, is the third.
Search is now a reason to keep an application on one database. Lakebase Search has been generally available since 18 September 2026 as Postgres extensions inside the project, on Postgres 16 and later: lakebase_vector adds approximate nearest-neighbour search through the lakebase_ann index, with the same vector types, distance operators and query syntax as pgvector, and lakebase_text adds BM25 ranking over standard tsvector columns through lakebase_bm25. A search bar or an agent's retrieval tool no longer needs a second store and a copy job to feed it, and a synced table can carry an embedding column from Unity Catalog straight into a vector(n) column. Enabling it in the project settings restarts every compute in the project and can't be undone, so we'd do it in a maintenance window, then:
CREATE EXTENSION lakebase_vector;
CREATE EXTENSION lakebase_text;
CREATE INDEX documents_embedding_idx ON documents
USING lakebase_ann (embedding vector_cosine_ops);The sizing is where we'd spend our attention. Databricks' benchmark on 4 million passages found that a Local File Cache about the size of the vector index held warm vector queries to single-digit milliseconds, and that cutting the candidate pool from 1,000 to 200 kept 90.5% of the top-10 results for a third of the page reads. It recommends an always-on 0.5 CU floor, $31 to $40 a month, to avoid cold starts. We'd budget that floor from the start on anything user-facing, so the first query doesn't pay the 1.3 seconds the Gilbert session measured on an idle endpoint, and measure recall on our own corpus before trading any of it for page reads.
We'd be slower with an existing Postgres that leans on particular extensions or version behaviour. Lakebase is Postgres-compatible rather than your Postgres, so a migration is an assessment, never a change of connection string. Regulated data is less of a blocker than it was. Lakebase has been SOC 2 Type 2 compliant since July 2026, has carried PCI-DSS and HITRUST in every AWS region since 8 September 2026, and is on by default in workspaces with the compliance security profile (HIPAA among them), so we'd check whether a regulated workspace already has the profile before assuming cardholder or patient data needs a second database.
Lakebase at a glance, October 2026 #
| Fact | As of 22 October 2026 |
|---|---|
| Postgres versions | 16, 17 (default) and 18, chosen at project creation |
| AWS regions | us-east-1, us-east-2, us-west-2, ca-central-1, sa-east-1, eu-central-1, eu-west-1, eu-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1 (availability) |
| Project limits | 3 root branches, 500 branches, 20 active computes, 6 read replicas per branch, 1 protected branch |
| Availability | High availability with automatic failover; disaster recovery to a secondary workspace in another region, failed over by hand (Disaster Recovery) |
| Generally available | Postgres APIs (14 August 2026), synced tables, Lakebase Search (18 September 2026) |
| Beta or Preview | Change data feed to Delta (Public Preview), snapshots and backup schedule APIs (Beta), LTAP Direct Writes for synced tables (Beta) |
The project is created in the workspace's region and can't move, so the region decision is made once.
How we'd run a pilot #
Skip the feature comparison, which is a tie. Take the largest database your team would want to copy, time a snapshot and restore on your current platform and price the restored instance, then branch the same data on Lakebase and time that. Then ask the engineers what they'd do differently if the copy took five seconds and cost almost nothing, and which of those things they avoid today.
If it justifies a pilot, this is the order we'd take it in. Create a project on the Postgres major version the application already runs and load a restored copy of production, never a fresh schema. Give CI the right to create branches with a TTL of a few hours, and run one migration job per pull request against its own branch. Set the restore window on purpose, since it applies to every branch and a longer one costs storage. Register the database as a Unity Catalog catalog so the analysts' first question about the new data is answered by a grant. Only then move one real write path, the decision log or an approval queue, before anything a customer depends on. LTAP covers the architecture this fits into.
What's popular