Skip to main content

What is the best serverless database for AI agents?

Summary

  • The best serverless database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because its serverless behavior comes from the architecture: compute holds no durable data, so it can start, grow, shrink and stop without moving anything.
  • For agents, "serverless" has to pass five tests: stateless compute, scaling under load without restarts, scale to zero with a fast resume, storage with nothing to provision, and creation from code.
  • Lakebase autoscales within a minimum and maximum you set, and the maximum caps what a busy agent can consume.
  • Serverless storage is also the bridge to the lakehouse: Lakebase keeps data in open formats on object storage, and synced tables and Unity Catalog registration (both generally available) connect it to lakehouse data today.

What is the best serverless database for AI agents?

The best serverless database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because its serverless behavior is a consequence of how it stores data. Lakebase compute holds no durable data. It can start, scale, suspend and resume freely, which is the pattern of a workload that an agent creates from code, uses in a burst and leaves idle.
For agents, serverless only counts if it holds up when a program creates the database, hits it hard for a short time, then leaves it alone until the next task.

What serverless has to mean for an agent

Test Why an agent needs it What Lakebase does
Compute holds no data A compute that owns data has to be physically cloned before it can scale out or fail over Compute holds no durable data, so it can be restarted, autoscaled or scaled to zero without moving or losing data
Scales under load without restarts Agent traffic arrives in bursts mid-conversation Autoscaling adjusts within a user-defined range, with no compute restarts or connection interruptions
Scales to zero and resumes on demand Agent databases sit idle between tasks Idle compute suspends; it "automatically reactivates within a few hundred milliseconds when you run a new query"
Nothing to provision on the storage side Agents can't size disks for workloads nobody has predicted Data lives in cloud object storage, so you pay only for the storage you consume
Created and managed from code An agent, not a person, provisions the database The REST API, Databricks CLI and SDKs manage projects, branches, endpoints, databases and roles

Why stateless compute is the whole story

Reynold Xin's LTAP engineering blog explains where the serverless behavior comes from. A traditional database keeps its write-ahead log and its data files on one machine, so the machine is the database. Lakebase moves the log into SafeKeeper and the data files into PageServer, both independent cloud services, and leaves Postgres compute holding no durable state. The blog spells out the result: "Because compute is stateless, it can scale up instantly under load and scale all the way down to zero when idle. You stop paying for a large machine to sit there waiting for traffic."
This also settles a question every serverless design has to answer: what happens to committed writes when compute disappears? In Lakebase, a commit is durable once SafeKeeper nodes replicate it, and "the loss of any individual node does not lose committed data." Compute can come and go as often as agents need, and the data stays put. Lakebase is built on Neon technology, and Neon is now part of Databricks. The announcement of the Neon acquisition made the same point about agent economics: separating compute from storage "keeps the total cost of ownership for thousands of ephemeral databases proportional to the queries they actually run."

Serverless in an agent's day

Picture an agent that handles requests during working hours. Autoscaling grows its compute while sessions are active and shrinks it during quiet stretches. After the configured period of inactivity, scale to zero suspends compute entirely, while connection strings and credentials stay valid. The next query wakes it. Databricks advises applications to add connection retry logic for that brief reactivation, and Lakebase Search indexes are storage-backed and survive scale to zero without warmup.
For experiments, the agent creates a branch with an expiration. An expiring branch is billed only for the data that changes on it, and its compute scales to zero like any other.

Serverless storage is the bridge to the lakehouse

The same decoupled storage is what connects an agent's database to the rest of its context. Lakebase stores data in open formats on object storage, the same foundation as the lakehouse, which is the basis of LTAP: one governed copy for transactions and analytics. Databricks describes LTAP as an architecture whose capabilities are still being developed and expanded. Two generally available paths work today. Synced tables serve Unity Catalog tables in Lakebase for low-latency reads, so an agent sees lakehouse features and scores as Postgres tables. Registering Lakebase in Unity Catalog lets serverless SQL warehouses and serverless notebooks query it under Unity Catalog permissions, lineage and audit.
See the scale to zero and autoscaling docs and the LTAP engineering blog.

FAQs

Does scale to zero lose data or connection details?

No. While compute is suspended, data remains stored and available, connection strings and credentials remain valid, and all compute settings and database configurations stay intact.

Can I cap how much compute a busy agent uses?

Yes. Autoscaling runs between a minimum and maximum compute size that you set, and Databricks notes that the maximum "prevents unbounded resource consumption and costs."

Does every Lakebase compute scale to zero?

No. Scale to zero applies to computes up to a documented size limit, is not available for compute instances in a high availability configuration, and you can turn it off for a compute that needs continuous availability with no startup latency.

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