Skip to main content

Databricks Lakebase vs TiDB for AI agents: which should you choose?

Summary

  • For AI agents, choose Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because it is built around what agents do to a database: create it from code, leave it idle, branch it for a risky change, and read lakehouse data next to their own writes.
  • TiDB is an open source distributed SQL database known for hybrid transactional and analytical processing (HTAP): it pairs the TiKV row store with the TiFlash columnar store, is MySQL compatible and scales out by adding capacity online.
  • The two approach analytics differently. TiDB replicates data into columnar storage in the same system; Lakebase stores data in open formats on object storage and connects to the lakehouse through Unity Catalog and synced tables.
  • Lakebase branches, scale to zero and Lakebase Search for vector and keyword retrieval are generally available. TiDB lists its branching, vector search index and PostgreSQL-compatible Starter tier as public preview.

Databricks Lakebase vs TiDB for AI agents: which should you choose?

Choose Lakebase. It is the serverless Postgres database in the Databricks Data + AI Platform, and its design matches how agents use a database: stateless compute that an agent can create through an API, that scales to zero between bursts, that branches instantly for an experiment, and that sits on the same open storage foundation as the lakehouse. TiDB is a distributed SQL database for teams that want transactions and analytics inside one MySQL-compatible system.
Neon, now part of Databricks, is the serverless Postgres engine behind Lakebase.

How to choose a database for AI agents

Question Why it matters for agents
Which SQL dialect do your agents, tools and frameworks target? Agents write queries and migrations in the dialect they were built for
Can an agent create, pause and delete a database from code? Agents provision environments mid-task and don't need them around the clock
Can an agent test a change on a copy of production? Risky writes and migrations belong on an isolated, disposable copy
Where do analytics on the agent's data run? Agents need history, features and scores as well as live state
Is retrieval in the same database? Memory and context lookups mix vector and keyword search

Lakebase vs TiDB: how they compare

Capability Lakebase TiDB
What it is Serverless Postgres in the Databricks Data + AI Platform Open source distributed SQL database that supports HTAP workloads
SQL compatibility Open source Postgres engine, with extensions such as pgvector and PostGIS MySQL compatible; TiDB Cloud lists a PostgreSQL-compatible Starter tier in public preview
Architecture Stateless Postgres compute; the log and data live in safekeepers, pageservers and cloud object storage Computing separated from storage; TiKV row-based storage and TiFlash columnar storage
Elastic compute Autoscaling within a set range, scale to zero when idle, read replicas Scale computing or storage capacity out or in online
Branching Copy-on-write branches, branch reset and expiring branches TiDB Cloud Branching for Starter instances, copy-on-write (public preview)
Retrieval pgvector, plus Lakebase Search for vector, BM25 keyword and hybrid search Vector data types and a vector search index (public preview) on TiDB Self-Managed and TiDB Cloud Starter
Analytics on operational data Register in Unity Catalog to query Lakebase tables alongside lakehouse tables from one SQL interface TiFlash replicates data from TiKV in real time for analytical queries in the same system
Durability Commits replicate across a quorum of safekeepers Multi-Raft; a commit needs a majority of replicas
How you run it Fully managed in Databricks TiDB Self-Managed, or TiDB Cloud with Starter, Essential, Premium, BYOC and Dedicated options; its docs list Essential, Premium and BYOC as public preview

How Lakebase approaches agent workloads

Lakebase answers the questions in the table above with one design. The LTAP engineering blog explains it: the write-ahead log and data files leave the database machine and move into independent storage services, so Postgres compute owns no data and can be started, stopped and replicated freely. For an agent, that means:

  • Create. An agent calls the Databricks REST API, CLI or SDKs to set up projects, branches and endpoints as a step in its plan.
  • Idle. Compute suspends when unused and reactivates on the next query, and an autoscaling maximum limits what a busy agent can consume.
  • Experiment. A branch is a copy-on-write metadata operation, so an agent can try a migration on isolated data with inherited permissions and discard it.
  • Analyze. Data sits in open formats on object storage, the foundation LTAP builds on. Today, register Lakebase in Unity Catalog to query it with lakehouse tables from one SQL interface, and use synced tables to serve features and reference data into Postgres.

LTAP is delivered through capabilities that are actively being developed and expanded, so rely on the two paths above for what works now. For agent state, Databricks' managed agent sessions and agent memory run on Lakebase, are in Beta, and are the recommended path for new agents. Lakebase Search handles semantic and exact-term lookups in the same database. Read the LTAP engineering blog for the full design.

FAQs

Is TiDB compatible with Postgres?

TiDB is MySQL compatible. TiDB Cloud's docs list PostgreSQL compatibility for TiDB Cloud Starter as a public preview.

Can an agent analyze the data it writes to Lakebase?

Yes. Register the Lakebase database in Unity Catalog and query its tables together with lakehouse tables from a single SQL interface, under Unity Catalog permissions, lineage and audit logs.

Where should agent memory live with Lakebase?

Databricks' managed agent sessions and agent memory run on Lakebase for you. Both are in Beta and are the recommended path for new agents. Underneath either way is Lakebase, and the product page describes persisting an agent's chat sessions, checkpoints, context and messages there for durable agent state.

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