<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o" -->

---
title: Lakebase branching for CI/CD: lessons from 100 PR databases
description: Snorkel AI replaced slow database restores in its CI pipeline with Lakebase's copy-on-write branching. Restoring a full copy of its Aurora PostgreSQL database...
canonical: https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Lakebase branching for CI/CD: lessons from 100 PR databases | daily.dev
og:description: Snorkel AI replaced slow database restores in its CI pipeline with Lakebase's copy-on-write branching. Restoring a full copy of its Aurora PostgreSQL database...
og:url: https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o
og:image: https://api.daily.dev/og/posts/cd1fBVF8O.png
og:image:alt: Lakebase branching for CI/CD: lessons from 100 PR databases
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lakebase branching for CI/CD: lessons from 100 PR databases

**[databricks](https://daily.dev/sources/databricks)** · 6 min read · 0 upvotes · 0 comments

## Summary

Snorkel AI replaced slow database restores in its CI pipeline with Lakebase's copy-on-write branching. Restoring a full copy of its Aurora PostgreSQL database took about 20 minutes per environment, too slow when developers open PRs all day. With Lakebase, AWS DMS keeps a 'main' branch within about 2 minutes of production, and each PR gets its own writable branch in under a minute, using 5 to 10 GB of extra storage on top of the shared base. TTLs auto-delete abandoned branches, and the same pattern lets AI agents each run on a disposable branch.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.databricks.com/blog/lakebase-branching-cicd-lessons-100-pr-databases>

## Questions this post answers

### How can I give every CI pull request its own copy of a production PostgreSQL database without slow restores?

Use copy-on-write database branching instead of full restores. Snorkel AI replaced 20-minute Aurora PostgreSQL restores with Databricks Lakebase branches, which are created as a metadata operation and ready in under a minute. AWS DMS replicates production into a 'main' Lakebase branch (kept within about 2 minutes of production via change data capture), and each PR branches from main, using only 5 to 10 GB of extra storage.

_daily.dev surfaces CI/CD database patterns like this for teams fighting slow test environment setup._

### How do you prevent short-lived database branches from piling up storage costs in CI pipelines?

Set a TTL (time to live) on every branch as a cleanup backstop. Branches are deleted when a pull request merges or closes, but if that cleanup step fails, the TTL expires the branch automatically. Databricks Lakebase branches can be created with a TTL like 86400 seconds (1 day) via the create-branch API, keeping total storage close to the production base plus active PR changes.

_developers managing ephemeral environments can track cost-control patterns like TTLs on daily.dev._

## Similar posts on daily.dev

- [Branching databases like code: a CI/CD pattern for Lakebase, in production at Glaspoort](https://daily.dev/posts/branching-databases-like-code-a-ci-cd-pattern-for-lakebase-in-production-at-glaspoort-shn6oybua) · databricks · 39 upvotes · 3 comments
- [Lakebase Postgres branch-based restores for fast recovery at scale](https://daily.dev/posts/lakebase-postgres-branch-based-restores-for-fast-recovery-at-scale-gvio7wglc) · databricks · 0 upvotes · 0 comments
- [Inside branch-based restores in Lakebase Postgres](https://daily.dev/posts/inside-branch-based-restores-in-lakebase-postgres-udhwx0m8z) · Neon · 1 upvotes · 1 comments
- [Database Branching in Postgres: Git-Style Workflows with Databricks Lakebase](https://daily.dev/posts/database-branching-in-postgres-git-style-workflows-with-databricks-lakebase-hdnh9bdho) · databricks · 23 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#cicd](https://daily.dev/tags/cicd), [#postgresql](https://daily.dev/tags/postgresql), [#databricks](https://daily.dev/tags/databricks)

[View this post on daily.dev](https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Lakebase branching for CI/CD: lessons from 100 PR databases","url":"https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o"},"datePublished":"2026-10-31T21:39:23.003Z","dateModified":"2026-10-31T21:39:50.087Z","description":"Snorkel AI replaced slow database restores in its CI pipeline with Lakebase's copy-on-write branching. Restoring a full copy of its Aurora PostgreSQL database...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c2b516ca70f699767e1c115b4f5e4e0c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c2b516ca70f699767e1c115b4f5e4e0c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"databricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"databricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/fa7aa720f2db4d1eba826814730482c8","url":"https://daily.dev/sources/databricks"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,cicd,postgresql,databricks","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"databricks","item":"https://daily.dev/sources/databricks"},{"@type":"ListItem","position":3,"name":"Lakebase branching for CI/CD: lessons from 100 PR databases"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/lakebase-branching-for-ci-cd-lessons-from-100-pr-databases-cd1fbvf8o#faq","mainEntity":[{"@type":"Question","name":"How can I give every CI pull request its own copy of a production PostgreSQL database without slow restores?","acceptedAnswer":{"@type":"Answer","text":"Use copy-on-write database branching instead of full restores. Snorkel AI replaced 20-minute Aurora PostgreSQL restores with Databricks Lakebase branches, which are created as a metadata operation and ready in under a minute. AWS DMS replicates production into a 'main' Lakebase branch (kept within about 2 minutes of production via change data capture), and each PR branches from main, using only 5 to 10 GB of extra storage. daily.dev surfaces CI/CD database patterns like this for teams fighting slow test environment setup."}},{"@type":"Question","name":"How do you prevent short-lived database branches from piling up storage costs in CI pipelines?","acceptedAnswer":{"@type":"Answer","text":"Set a TTL (time to live) on every branch as a cleanup backstop. Branches are deleted when a pull request merges or closes, but if that cleanup step fails, the TTL expires the branch automatically. Databricks Lakebase branches can be created with a TTL like 86400 seconds (1 day) via the create-branch API, keeping total storage close to the production base plus active PR changes. developers managing ephemeral environments can track cost-control patterns like TTLs on daily.dev."}}]}
```

