↩
Synthetic Data Agent · 17 November 2026

đŸ€– SDA 09: Why We Picked Lakebase

Choosing the operational database for the SDA meant testing transactions, reconnects, governance, ownership, and the boundary between Lakebase and Delta.

16 min read
SDA 09: the Lakebase decision, with the benchmark treated as evidence rather than the whole argument.
0% read·16 min in this view

In SDA 08, the Synthetic Data Agent learned to remember: requests, plans, runs, approvals, and evidence didn’t disappear with the conversation.

That raised a less glamorous question: where should an agent keep the state that coordinates its next move?

This article explains why the choice isn’t just a latency chart — it’s about workload, governance, ownership, and executable boundaries.

The decision is narrower than “Lakebase is the best database.” It’s the best fit for the operational control plane the SDA has actually built.


Start With the Workload, Not the Database

The SDA Needs an Operational Control Plane

The state store isn’t another analytical repository. It coordinates requests, runs, plan versions, workflow steps, checkpoints, leases, approvals, artifact references, warnings, failures, and retries.

Those records are small, but they change frequently while the application, Databricks jobs, and deterministic tools coordinate the same workflow. The useful operations are ordinary application-database operations:

  • Find one request or run by identifier.
  • Create a request exactly once when a client retries.
  • Update a state projection only if its version is still current.
  • Acquire a lease before a worker executes a step.
  • Renew that lease without letting another worker take the same work.
  • Record a failed attempt without erasing it when a retry starts.
  • Approve a plan without rewriting the earlier decision.
  • Commit a step checkpoint together with its artifact references.

That workload wants short transactions, indexed point lookups, enforced relationships, conditional writes, and safe concurrency. It looks like an operational PostgreSQL workload.

The SDA doesn’t need another place to store synthetic tables. It needs a database that can safely decide what the system is allowed to do next.

Analytical Evidence Has a Different Shape

Profiles, histograms, categorical distributions, relationship metrics, pattern evidence, validation details, generated datasets, and long-term quality histories are different artifacts. They are larger, mostly immutable or append-oriented, and naturally processed through Spark and SQL.

Those artifacts remain in Unity Catalog and Delta. The state store keeps their operational index: an artifact ID, source snapshot, configuration fingerprint, location, status, and compact summary. It doesn’t copy every histogram bucket into a run table.

This is the boundary introduced in SDA 08:

Lakebase remembers what the workflow is doing and which evidence it is allowed to use. Delta preserves the evidence of what the system learned and produced.

The boundary is now encoded in src/sda/lakebase_decision.py. The code gives operational ownership to requests, runs, plans, steps, leases, approvals, feedback, transition history, audit events, and artifact references.

It gives analytical ownership to profiles, distributions, relationship evidence, pattern evidence, validation detail, generated datasets, and historical quality and cost analytics.

It also names three things that don’t belong in the operational store:

  • Raw source rows
  • Complete histograms
  • Generated synthetic tables

Turn Requirements Into Decision Criteria

Before comparing products, we need criteria that describe the work. Otherwise, the decision matrix becomes a retrospective justification for a choice already made.

Transactional Correctness

The state store must be able to:

  • Create each logical request once.
  • Start a run against a specific plan version.
  • Acquire a lease before executing a step.
  • Reject an update based on a stale version.
  • Preserve a rejected or superseded plan.
  • Complete a step and register its output references together.
  • Preserve failed attempts instead of resetting their history.

These operations require transactions, constraints, conditional writes, and concurrency controls.

Low query latency is useful only if the result is correct.

Latency and Concurrency

The relevant benchmark isn’t a maximum scan-throughput contest. The questions are smaller and more specific:

  • How quickly can the application retrieve one state record?
  • How quickly can it complete a short state transaction?
  • What happens when two workers claim the same stage?
  • What happens when a connection is interrupted?
  • What latency appears when suspended compute resumes?

Lakebase scale-to-zero closes idle connections and discards session state such as temporary tables, prepared statements, advisory locks, and LISTEN/NOTIFY registrations.

The application must tolerate a new session rather than quietly depending on the old one.

Databricks Integration

The comparison also needs to include the surrounding platform:

  • Databricks Apps, jobs, and notebooks.
  • Users, groups, service principals, and OAuth.
  • Unity Catalog and Delta.
  • Declarative Automation Bundles.
  • Isolated development, staging, and production environments.

Every additional credential flow, network path, firewall rule, synchronization process, and deployment system is another component to secure and operate.

Governance and Security

We need identity mapping, least-privilege roles, infrastructure permissions, auditability, encryption, private connectivity, and a clear separation between operational state and sensitive analytical evidence.

Lakebase has separate authorization layers. Project permissions control infrastructure operations such as branches and compute. PostgreSQL roles and grants control direct database access. A Unity Catalog registration governs the read-only catalog representation.

These layers complement one another; they aren’t automatically synchronized.

The Lakebase Unity Catalog registration documentation is explicit about the boundary:

Registration creates a read-only catalog. Direct writes still go through PostgreSQL access, where PostgreSQL roles remain authoritative.

Delivery and Operational Ownership

The decision includes the full operating model:

  • Infrastructure as code and schema migrations.
  • Environment isolation.
  • Backup and recovery testing.
  • Monitoring and connection management.
  • Upgrades and incident response.
  • Cost ownership and attribution.

A good benchmark result can still produce a poor architecture if the database requires a second delivery platform, duplicated monitoring, bespoke connectivity, and an unclear owner.

Portability and Exit Cost

Platform integration has value, but it also creates coupling.

  • We need to know how much of the application remains ordinary PostgreSQL: SQL, drivers, schemas, migrations, and tools.
  • We also need to name the Databricks-specific dependencies: OAuth roles, branches, bundle resources, and optional Unity Catalog registration.

“PostgreSQL compatible” isn’t a reason to skip testing product-specific behavior. It’s a reason to make the exit path understandable and to test the differences that matter.

Compare the Candidates

Delta Tables

Delta was an attractive option because it already holds the SDA’s evidence plane. It provides ACID transaction guarantees — atomicity, consistency, isolation, and durability — plus schema enforcement, table history, time travel, Unity Catalog governance, and scalable processing through Spark and SQL.

For full profiles, relationship graphs, pattern registries, validation detail, historical metrics, and generated synthetic tables, Delta remains the right choice.

We shouldn’t reject Delta using the old claim that it lacks transactions. Databricks now supports transactions spanning multiple statements and tables for qualifying Unity Catalog managed Delta or Iceberg tables with catalog commits enabled.

The feature has requirements: supported table types, supported compute, and transaction-safe operations. DDL and some metadata operations remain outside the transaction boundary, and interactive transactions use more conservative conflict detection.

The more relevant distinction is integrity. Databricks enforces NOT NULL and CHECK constraints, but primary-key, foreign-key, and unique constraints are informational rather than enforced.

None of this makes Delta inferior. It makes the boundary clearer. A Delta table can represent many state-machine patterns with MERGE, optimistic concurrency, and transactions. The question is whether those patterns are the most natural way to implement a small application run store with enforced relational identity, point updates, leases, and retries.

For the SDA, Delta was retained for the work it handles best. Using it for every layer would remove one technology name while making the operational repository less natural and more constrained.

External Managed PostgreSQL

External PostgreSQL isn’t a weak alternative. PostgreSQL provides mature transaction and concurrency semantics, standard client interfaces, extensive operational tooling, and familiar patterns for monitoring, backup, high availability, and replication.

It would be the right choice in an organization that already has a managed PostgreSQL platform, approved extensions, standard network patterns, and a database team that owns migrations and incidents. It would also be a good choice if most applications and users lived outside Databricks.

The cost is architectural rather than merely financial. An external service adds another platform boundary:

  • Separate provisioning and deployment.
  • Independent networking and private endpoints.
  • Another identity, credential, and secret lifecycle.
  • Database permissions outside the Databricks model.
  • Separate monitoring, backup testing, and incident response.
  • Another ownership agreement between the application, data platform, security, and database teams.

None of that is inherently bad. Mature organizations operate these controls successfully every day. For this project, however, the additional boundary would add work without improving profiling, generation, or validation.

External PostgreSQL remains a credible alternative. It didn’t lose because it’s a worse database. It lost because the SDA team doesn’t already have a separate database platform whose existing value outweighs the integration cost.

Lakebase Postgres Autoscaling

Lakebase supplies a managed PostgreSQL service integrated with Databricks. That makes it a natural home for the SDA’s operational state: short transactions, constraints, indexed lookups, workflow records, and concurrent state changes.

This is the fundamental reason for the choice. Autoscaling, scale-to-zero, branching, OAuth roles, and bundle resources support the decision. They don’t replace workload fit.

Less Application Plumbing

Databricks Apps can add a Lakebase resource. The App uses its service principal; Databricks creates a matching PostgreSQL role and injects connection settings such as PGHOST, PGDATABASE, PGUSER, and PGSSLMODE.

The SDA’s LakebaseConnectionConfig.from_environment consumes those non-secret settings. Token acquisition remains lazy, so a new connection can ask for a fresh credential instead of holding a token forever.

The same adapter can use a standard PostgreSQL DSN — a database connection string — for jobs and local acceptance. connect_lakebase calls the token provider on each connection attempt, uses TLS, applies bounded exponential backoff, and retries connection establishment only. It never retries a repository mutation.

Retrying a connection is one problem; repeating an approval insert or state transition is another.

Close to Unity Catalog Without Becoming Delta

A Lakebase database can be registered in Unity Catalog as a read-only catalog. That enables discovery, governed read access, lineage, and cross-source queries beside Delta data. It doesn’t turn the registration into the write path.

That gives the SDA a useful hybrid architecture:

  • Lakebase handles active requests, runs, approvals, leases, and checkpoints.
  • A registered catalog can expose selected operational state for analysis.
  • Unity Catalog and Delta retain full profiles, validation evidence, and synthetic outputs.
  • Direct PostgreSQL writes continue to use database roles and grants.

Registration is optional for the state repository and isn’t claimed as a live acceptance result here.

It Fits the Deployment Model

The SDA has used Declarative Automation Bundles since SDA 03. Lakebase projects, branches, endpoints, roles, and databases are declared in bundle/lakebase.yml alongside the jobs and applications.

The dev target uses an isolated, non-expiring dev branch, a read/write primary endpoint, an OAuth role, and the sda_state database. The root production branch is protected, and the bundle declares a daily snapshot schedule with seven-day retention.

This doesn’t replace migrations. The versioned schema in schema/lakebase/001_state_schema.sql is applied explicitly by scripts/apply_state_schema.py, not when the application starts. The schema runner hashes the filename and SQL content, records the result in sda_schema_versions, and makes the second application a no-op.

Test the Decision

The Benchmark Established Viability, Not the Decision

The repository now contains scripts/benchmark_state_store.py. It’s intentionally small and disposable. It measures the two operations that justify an operational state store:

  1. connect_and_ping: open a fresh PostgreSQL connection and run SELECT 1.
  2. request_insert_select_delete: insert one request, read it back, and delete it in one short transaction.

The probe uses a unique request marker and deletes it in a finally block. It never prints the DSN or credential. It isn’t a synthetic-data throughput benchmark or a controlled three-way comparison; it’s a workload-specific probe for the operational paths that matter here.

The probe is deliberately workload-specific. It establishes that the chosen connection and transaction paths are viable for the control plane, without pretending to be an SLA — a service-level agreement — or a controlled three-way comparison. It doesn’t answer who should own the database, how it should be governed, or whether another platform would be better for a different organization.

The Decision Matrix Without the Spreadsheet

CriterionLakebase PostgresDelta tablesExternal PostgreSQL
Transactional stateBest fit for short PostgreSQL transactions, enforced relational constraints, leases, and point updatesACID is available, but the application-state model is more constrained and key constraints are informationalStrong fit with mature PostgreSQL semantics
Analytical scaleNot the destination for complete evidence or generated dataBest fit for profiles, distributions, validation, history, and generated tablesPossible, but would duplicate or complicate the evidence plane
Databricks integrationStrong: identities, bundles, branches, endpoints, and Apps stay close to the workflowNative Unity Catalog and Spark integrationRequires separate networking, credentials, deployment, and monitoring
GovernancePostgreSQL roles for direct access; optional read-only Unity Catalog registration; project permissions remain separateDeepest native Unity Catalog governance for analytical assetsSeparate authorization model, with federation if needed
Operational ownershipOne platform boundary for the SDA team, with explicit database engineering still requiredLeast infrastructure, but a less natural control-plane workloadBest where a mature database team already exists
PortabilityStandard PostgreSQL clients reduce exit cost; Databricks OAuth and branches add couplingStrong analytical portability, but not the chosen state-store semanticsHighest platform independence

The overall decision is therefore:

Use Lakebase Postgres Autoscaling for the SDA’s operational control plane.
Use Unity Catalog-governed Delta tables for complete analytical artifacts, generated datasets, validation history, quality reporting, cost analysis, and audit datasets.

The benchmark says Lakebase is fast enough for the workload we measured. The architecture says why it is useful in the system we actually have.

Make the Decision an Architectural Contract

An architecture decision is more useful when it can be tested. SDA 09 adds five concrete contracts around the decision.

Contract #1: The Storage Boundary Is Executable

src/sda/lakebase_decision.py names the two storage planes, their record types, their non-goals, and the conditions that should reopen the decision. Tests reject overlapping ownership and verify that raw rows, complete histograms, and generated tables are not operational payloads.

Contract #2: The Connection Path Is Reconnect-Safe

LakebaseConnectionConfig.from_environment reads non-secret connection settings from the variables Databricks Apps expose. environment_token_provider remains lazy. connect_lakebase requests a token for each connection attempt and never logs it.

The behavior is covered by unit tests and by the live connection probe. A fresh connection can recover from an idle endpoint without depending on a permanent session.

Contract #3: The State Schema Is Versioned and Relational

The schema contains 11 sda_* tables, including schema versions, requests, runs, plans, attempts, approvals, feedback, audit events, transition history, run steps, and artifact decisions. Foreign keys and uniqueness constraints are part of the schema rather than comments in an architecture decision record (ADR) — a short document that records why a team chose an option, what boundaries it accepts, and when the decision should be revisited.

Schema application is idempotent, and the cleanup check verifies that disposable state does not remain after the acceptance path.

Contract #4: The Full Lifecycle Is Disposable and Repeatable

scripts/run_sda09_live_lifecycle.py exercises the part of the contract a benchmark cannot see:

  • request creation
  • run creation and a legal transition
  • immutable plan creation
  • audit event and approval persistence
  • a failed step followed by a successful retry
  • a reused artifact decision
  • lease acquisition and renewal
  • successful attempt completion

The lifecycle acceptance covers the complete path and cleans child history before parent rows, including transition events. Disposable request markers are removed as part of the same repeatable contract.

Contract #5: The Generation Boundary Is Bounded and Testable

SDA 09 doesn’t move generated rows into Lakebase, but it does make the existing Delta generation boundary executable. src/sda/generation.py enforces approved plans, deterministic seeds, row-count budgets, schema contracts, receipts, and generation manifests.

The Databricks bundle deploys src/sda/job_entrypoints/generate_spark.py as the standalone Spark writer and src/sda/job_entrypoints/validate_generated_spark.py as its bounded technical gate.

The writer reconstructs the approved plan, verifies its fingerprint, writes a Delta table, and emits a manifest with the run, plan, source snapshot, artifact, receipt, and output fingerprint.

The validation job checks the required schema and expected row count, then persists a versioned validation report in Delta.

The deployed acceptance path verifies the writer, manifest, validator, cleanup, and Unity Catalog boundary. It is a deployment and contract smoke test, not a production-scale capacity claim or a full SDA 10 relational-generation scenario.

Boundaries and Payoff

What This Decision Doesn’t Claim

Native integration isn’t the same as correctness. Lakebase still has product-specific behavior and limits that must be checked against production requirements.

This article doesn’t claim:

  • A measured external PostgreSQL competitor result.
  • A measured Delta control-plane competitor result.
  • Unity Catalog registration of the Lakebase database.
  • Production service-principal permissions.
  • High availability or cross-region recovery.
  • Region availability for every future deployment.
  • A production latency or cost SLA.

When We’d Reopen the Decision

Those aren’t hidden failures. They’re explicit revisit conditions in ADR 0004, the architecture decision record for this choice: unavailable region, unsupported extension or network control, mandatory independent ownership, failed latency/availability objectives, unmet recovery objectives, consumers moving outside Databricks, or material cost and connection limits.

External PostgreSQL should win if those constraints matter more than platform integration. Delta should continue to win for analytical evidence.

The decision isn’t a logo preference and it isn’t permanent by ceremony.

The Fastest Component Isn’t Always the Simplest System

SDA needed more than durable storage. It needed a transactional control plane that could coordinate concurrent tools, prevent duplicate work, preserve approvals, recover from failures, and expose state through ordinary application patterns.

Lakebase matched that workload while staying close to the Databricks applications and workflows already using it. Delta remained the right home for profiles, validation evidence, historical analytics, and generated tables. External PostgreSQL remained technically sound, but it would have introduced more identity, networking, deployment, and operational boundaries for this project.

The benchmark mattered because Lakebase still had to meet the workload’s latency and reconnect requirements. Speed established viability. The architecture established usefulness.

The agent now has governed evidence, durable memory, and a database selected for the work rather than the logo. The bounded generator and validator are deployed and verified.

SDA 10 can now extend that path into full relational generation while preserving the distributions and null behavior that make the source data believable.


Lakebase now has a job description, a boundary, and receipts. The next article can build on that without pretending that a benchmark was an architecture.


🔗 Source Code

The code for this article is available in the SDA-09 branch:

🔗 synthetic-data-agent

🎧 YouTube playlist


SDA 09 — Why We Picked Lakebase
SDA 09 — Why Lakebase fits the SDA control plane: speed proves viability; architecture proves usefulness.
79Published
22,889Visits
9,555Read
VisitsReadLAST 5 WEEKS