AI Agent News/stories/snorkel-ai-gives-each-pull-request-its-own-lakebase-database-branch.md

Infrastructure

Snorkel AI gives each pull request its own Lakebase database branch

Snorkel AI now gives every open pull request its own Lakebase Postgres branch, a writable copy of production data that is ready in under a minute instead of more than 30 minutes. Branches are copy-on-write and expire automatically through TTL, so about 100 concurrent PR databases on a roughly 2.5 TB dataset add only the storage their changes need.

Source: www.databricks.com/blog/lakebase-branching-cicd-lessons-100-pr-databases

Snorkel's CI pipeline on Kubernetes creates an ephemeral namespace for each pull request, and restoring a copy of its Aurora PostgreSQL database took about 20 minutes per environment. Shared staging databases, trimmed fixtures and synthetic data were ruled out because they bring back test interference, stale schemas and bugs that only appear with real data.

Snorkel uses AWS DMS to replicate its Aurora database into the main branch of a Lakebase project, with a full load followed by change data capture that keeps main within about 2 minutes of production. When a PR opens, the pipeline calls the Lakebase API to create a branch from main with an expiration time, then deletes it when the PR merges or closes, with TTL as a backstop.

Developers sign in through Okta SSO, while CI pipelines run as Databricks service principals that obtain short-lived OAuth tokens, and traffic stays on private networking. Each PR branch writes about 5 to 10 GB of changes on a roughly 1 TB base, and compute scales to zero between runs. The rollout reached 60 to 70 developers across teams.

Why it matters if you build agents

Teams building agents can give each test run or agent task a disposable branch of a production-scale Postgres database, created in seconds regardless of database size. Without expiration, old branches keep holding older storage pages as main is updated, so set a TTL that matches how long a run usually lasts. Run automated workloads as service principals with short-lived tokens so every query can be traced in the audit logs.

Get stories like this every weekday

One short email with the day's agent tooling news.

Subscribe