Skip to main content

Which transactional database is best for agents? Pick one

Summary

  • The best transactional database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. Agents can create it from code, let it scale to zero when idle and branch it like code.
  • Judge a database for agents on four tests: spin up on demand, spin down when work stops, branch so risky changes run in isolation, and connect back to governed data in the lakehouse.
  • Lakebase moves the write-ahead log and data files off the database machine into independent storage services (SafeKeeper and PageServer), so its Postgres compute is stateless and can start, stop and scale freely.
  • A Lakebase branch is a copy-on-write metadata operation: it appears instantly at any size, stays isolated from its parent and can expire on its own, so each agent task can get a disposable branch of production.
  • LTAP, the architecture Databricks is rolling out, puts transactions and analytics on one copy of data. Today, Unity Catalog registration and synced tables are the generally available paths between agents and the lakehouse.

Which transactional database is best for agents? Pick one

Pick Lakebase. The best transactional database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. Its compute owns no durable data, so it can start, scale, pause at zero and branch without copying data, which suits software that creates and discards databases at machine speed. Its data sits in open formats on cloud object storage, the same foundation as the lakehouse, and once a database is registered in Unity Catalog, analysts can query what an agent writes next to the rest of your data.
Neon, now part of Databricks, is the serverless Postgres engine behind Lakebase, and it's still Postgres: "the wire protocol, SQL, drivers, and extensions all work as-is."

What agents change about the database workload

Transactional databases grew up around a human rhythm: one server, one application for years, careful schema changes. Agents break it.

  • They provision from code. When Databricks announced it would acquire Neon in 2025, it said most databases provisioned on Neon were created by AI agents rather than by humans.
  • They work in bursts. Heavy activity while a task runs, then nothing. A database sized for the peak pays for idle capacity the rest of the time.
  • They make risky changes. Agents write SQL and run migrations, and a mistake must not reach production.
  • They need fresh operational data and lakehouse context together. Databricks product manager Jonathan Katz uses fraud as the example: an agent "working off a batch copy of the data that's minutes or hours old" is "simply too slow to catch anything before the transaction has already gone through." It usually needs analytical history and features too.
  • They arrive as a herd. As Katz puts it, "A herd of agents can easily overwhelm an operational system if there aren't guardrails in place."

Those pressures reduce to four tests: spin up, spin down, branch and connect back to the lakehouse.

The four tests, scored

Test What an agent does What the database must do How Lakebase does it Question to ask in an evaluation
Spin up Creates a database or branch mid-task Provision by API and scale with load Stateless compute; generally available REST API, CLI and SDKs; autoscaling within a range you set Can an agent get an isolated, writable database from one API call?
Spin down Finishes or goes quiet Stop charging when idle and resume on the next query Scale to zero suspends idle compute and reactivates it automatically when the next query arrives What does an idle agent database cost?
Branch Tests a migration or writes speculative data Copy production instantly and discard the copy Copy-on-write branches that appear instantly at any database size, with optional automatic expiration Can we discard a bad agent change without production noticing?
Connect back Reads lakehouse features and hands its writes to analytics Serve lakehouse data fast and bring operational data under analytics governance Synced tables, plus Unity Catalog registration for permissions, lineage, audit logs and cross-source SQL Can analysts query agent writes without a pipeline we maintain?

Why the architecture decides the answer

Every test comes down to where the database keeps its state. A traditional database keeps two things on disk: the write-ahead log (WAL), which makes commits fast and safe, and the data files, which make reads fast. Databricks cofounder Reynold Xin names the cost in his LTAP engineering blog: "Almost every traditional database keeps its write-ahead log and data files on one machine's disk, which is the root cause of data loss risk, expensive read replicas and high-availability clones, and analytics queries that drag down transactions." For agents, that means a new machine per database and a full data copy per clone.
Lakebase moves both off the machine:

  • The WAL becomes SafeKeeper. A commit is durable once its log record is replicated across a quorum of SafeKeeper nodes using Paxos, not when one local disk reports a flush. "The loss of any individual node does not lose committed data."
  • The data files become PageServer. Pageservers rebuild pages from the log and persist them to cloud object storage.
  • Compute becomes stateless. "The compute layer becomes a stateless Postgres engine that can be started, stopped, and replicated freely, because it no longer owns the data."

That separation is what makes autoscaling, scale to zero, instant branches, read replicas and fast failover possible, and Xin notes it comes with no meaningful added latency. For agents, the biggest change is branching: "a branch or a clone is a metadata operation rather than a physical copy," so an agent can branch a large production database in seconds, run a risky migration on the branch and throw it away. In Xin's words, "The database finally moves as fast as your code."

LTAP: the architecture Databricks is rolling out

What makes LTAP (Lake Transactional/Analytical Processing) possible, Xin writes, is that Lakebase keeps operational data on object storage in an open format that other engines can read.
LTAP keeps Postgres, with full ACID semantics, for transactions and the lakehouse engines for analytics, over one durable copy in open columnar formats such as Delta and Iceberg. In this design, Lakebase storage writes that copy as it flushes data, off the Postgres instance serving your app. HTAP puts both workloads in one engine; LTAP unifies at the storage layer. The end state: "A table that exists is, by construction, already in the lake and already queryable."
Databricks said in June 2026 that LTAP would roll out over the coming months, and "LTAP is an architecture, not a single feature. Databricks delivers it through a set of Lakebase capabilities that are actively being developed and expanded."

What connects agents to the lakehouse today

Two connect-back paths are generally available on every cloud:

  • Register Lakebase in Unity Catalog. Registration creates a read-only catalog for a Postgres database. Unity Catalog permissions, lineage and audit logs apply to analytical access, and analysts join Lakebase and lakehouse tables on serverless compute.
  • Synced tables. A Unity Catalog table syncs into Lakebase as a read-only Postgres table, so agents read lakehouse features, predictions or reference data with low latency.

Governance runs in two layers for now: Unity Catalog governs analytical access and Postgres privileges (GRANT and REVOKE) govern connections, since Unity Catalog does not yet govern individual Postgres tables directly. The LTAP overview lists each capability's status by cloud.

One agent task, end to end

Take one generic task: an operations agent in an order-management app must merge duplicate customer records in the app's own tables and add a uniqueness constraint so they can't come back.

  1. Read context. The app runs on Databricks Apps with Lakebase as an app resource, and the agent's conversation history and checkpoints persist in Lakebase too. To find the duplicates, it reads a cleansed customer reference table that a lakehouse job maintains, served into Lakebase as a read-only synced table.
  2. Spin up. The agent creates an expiring branch of production through the Lakebase API (code below). The branch appears instantly, creating it doesn't slow production, and it is billed only for the data that changes on it.
  3. Write and validate. It merges the records and adds the constraint on the branch, then checks the result with SQL.
  4. Decide. A wrong result is discarded with the branch. A right one goes to production through your normal migrations (branch reset only flows from parent to child), with human approval if your policy requires it.
  5. Spin down. At its expiration time, the branch and its compute are deleted automatically.
  6. Connect back. Production is registered in Unity Catalog, so an analyst queries the cleaned table from a serverless SQL warehouse, joins it to lakehouse tables and checks its lineage. Nobody built a pipeline for this task.

Step 2 in the Databricks SDK for Python, adapted from the Lakebase docs:

from databricks.sdk import WorkspaceClient
from databricks.sdk.service.postgres import Branch, BranchSpec, Duration

w = WorkspaceClient()

# A disposable branch of production for one task, deleted automatically after an hour
task_branch = w.postgres.create_branch(
    parent="projects/orders-app",
    branch=Branch(spec=BranchSpec(
        source_branch="projects/orders-app/branches/production",
        ttl=Duration(seconds=3600),
    )),
    branch_id="dedupe-task",
).wait()

Warning signs a database will slow your agents down

  • Creating a database or a copy of production takes a ticket or a full data copy.
  • Idle databases bill like busy ones, so a database per agent task is too expensive to try.
  • Operational data reaches analytics only through a replication pipeline that covers the tables you pick and runs behind.
  • Compute has no ceiling, so a herd of agents can grow cost without limit.

How Lakebase approaches agent workloads

  • Branches with expiration. Each branch has its own compute that you scale independently, and "agents run on isolated branches with inherited permissions."
  • Point-in-time restore and high availability. A restore creates a new branch and leaves the original running. High availability adds standby computes in other availability zones and promotes one automatically if the primary fails, so your application continues from the last committed transaction; storage is highly available either way.
  • Lakebase Search. Generally available vector, keyword and hybrid search inside Postgres, with storage-backed indexes that survive scale to zero without warmup, alongside extensions such as pgvector and PostGIS.
  • Agent state. Persist an agent's chat sessions, checkpoints, context and messages in Lakebase. For new agents, Databricks recommends its managed agent sessions and agent memory, which it runs on Lakebase for you; both are in Beta. Because Lakebase is standard Postgres, a framework's Postgres checkpointer can also connect to it.
  • Databricks Apps. Attach Lakebase as an app resource, and Databricks creates a Postgres role for the app's service principal.

FAQs

Is Lakebase real Postgres?

Yes. Lakebase runs open source Postgres, not a fork or a new SQL dialect, so standard Postgres clients, drivers, ORMs and most popular extensions work, and Postgres applications run with minimal or no changes.

How does Neon relate to Lakebase?

Neon has been part of Databricks since 2025, and its design, durable cloud object storage paired with elastic compute, became the foundation of Lakebase. Xin writes that capabilities such as elastic compute, durable writes and instant branching are already widely available in Lakebase on both Databricks and Neon.

Does scale to zero slow down an agent's first query?

Only briefly. A suspended compute "automatically reactivates within a few hundred milliseconds when you run a new query," so agents should retry connections. Temporary tables and prepared statements reset when a compute suspends, so keep anything the agent needs later in regular tables. Turn scale to zero off where an endpoint must answer immediately; high-availability computes don't scale to zero at all.

Can agents work on production data safely?

Yes, on branches. A branch shares production's data through copy-on-write, creating one has no performance impact on production, and it keeps data, roles and grants isolated from its parent. If a bad change still lands, point-in-time restore recovers the earlier state in a new branch.

How do you keep a herd of agents from overwhelming the database?

Isolate and cap. Give heavy or experimental agents their own branches and compute, set an autoscaling maximum on every compute, add read replicas for read-heavy agents (they duplicate no data and are eventually consistent), and give each agent a Postgres role with only the grants it needs. A project also caps how many computes run at once, and scale to zero helps a fleet of task branches stay under that cap.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.