Back to directory
postgres-ai avatar

database-lab-engine

DBLab enables 🖖 database branching and ⚡️ thin cloning for any Postgres database and empowers DB testing in CI/CD. This optimizes database-related costs while improving time-to-market and software quality. Follow to stay updated.. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/postgres-ai/database-lab-engine.git

2,695

Stars

84

Forks

25

Watchers

Apache-2.0

License


DBLab Engine

⚡ Blazing-fast PostgreSQL cloning and branching 🐘

🛠️ Build powerful dev/test environments.
🔃 Cover 100% of DB migrations with CI tests.
💡 Quickly verify ChatGPT ideas to get rid of hallucinations.

Available for any PostgreSQL, including self-managed and managed services* like AWS RDS, GCP Cloud SQL, Supabase, and Timescale.

It can be installed and used anywhere: across all cloud environments and on-premises.

Postgres AI orange Latest release

CI pipeline status Go report

Contributor Covenant Community Slack Twitter Follow


*For managed PostgreSQL cloud services like AWS RDS or Heroku, direct physical connection and PGDATA access aren't possible. In these cases, DBLab should run on a separate VM within the same region. It will routinely auto-refresh its data, effectively acting as a database-as-a-service solution. This setup then offers thin database branching ideal for development and testing.

Why DBLab?

  • Build dev/QA/staging environments using full-scale, production-like databases.
  • Provide temporary full-size database clones for SQL query analysis and optimization (see also: SQL optimization chatbot Joe).
  • Automatically test database changes in CI/CD pipelines, minimizing risks of production incidents.
  • Rapidly validate ChatGPT or other LLM concepts, check for hallucinations, and iterate towards effective solutions.

For example, cloning a 1 TiB PostgreSQL database takes just about 10 seconds. On a single machine, you can have dozens of independent clones running simultaneously, supporting extensive development and testing activities without any added hardware costs.

dle demo animated

Try it yourself right now:

How it works

Thin cloning is fast because it is based on Copy-on-Write (CoW). DBLab employs two technologies for enabling thin cloning: ZFS (default) and LVM.

Using ZFS, DBLab routinely takes new snapshots of the data directory, managing a collection of them and removing old or unused ones. When requesting a fresh clone, users have the option to select their preferred snapshot.

Read more:

Where to start

Case studies

Features

  • Speed & scale
    • Blazing-fast cloning of PostgreSQL databases – clone in seconds, irrespective of database size
    • Theoretical max of snapshots/clones: 264 (ZFS, default)
    • Maximum size of PostgreSQL data directory: 256 quadrillion zebibytes, or 2128 bytes (ZFS, default)
  • Support & technologies
    • Supported PostgreSQL versions: 10–18
    • Thin cloning (CoW) technologies: ZFS and LVM
    • UI for manual tasks and API & CLI for automation
    • Packaged in Docker containers for all components
  • PostgreSQL containers
    • Popular extensions including contrib modules, pgvector, HypoPG and many others (docs)
    • Customization capabilities for containers (docs)
    • Docker container and PostgreSQL configuration parameters in the DBLab config
  • Source database requirements
    • Location flexibility: self-managed PostgreSQL, AWS RDS, GCP Cloud SQL, Azure, etc.—no source adjustments needed.
    • No ZFS or Docker requirements for source databases
  • Data provisioning & retrieval
    • Simple-mode setup: paste source URL + password, get a probed configuration in one click (UI Configuration → Simple tab)
    • Expert-mode form for both logical (dump/restore) and physical (WAL-G, pgBackRest) retrieval
    • Physical (pg_basebackup, WAL-G, pgBackRest) and logical (dump/restore) provisioning
    • Partial data retrieval in logical mode (specific databases/tables)
    • Database renaming during snapshot creation (databaseRename option)
    • Continuous update in physical mode
    • Periodic full refresh in logical mode without downtime
  • Recovery & management
    • Fast Point in Time Recovery (PITR) for physical mode
    • Auto-deletion of unused clones
    • Time-based auto-deletion of unused branches and snapshots (retention config; safe-only, never force-deletes dependents)
    • Snapshot retention policies in DBLab configuration
  • Clones, branches & snapshots
    • "Deletion protection" for clones, branches, and snapshots (blocks manual and auto-deletion, plus count-based retention for snapshots)
    • Persistent clones withstand DBLab restarts
    • "Reset" command for data version switching
    • Resource quotas: CPU, RAM
  • Monitoring & security
    • /healthz API endpoint (no auth), extended /status endpoint (API docs)
    • Prometheus metrics endpoint (/metrics) for monitoring
    • Netdata module for insights

How to contribute

Support us on GitHub/GitLab

The simplest way to show your support is by giving us a star on GitHub or GitLab! ⭐

Add a star

Spread the word

  • Tweet about DBLab and mention @Database_Lab.
  • Share a link to this repository on your favorite social media platform.

Share your experience

If DBLab has been a vital tool for you, tell the world about your journey. Use the logo from the ./assets folder for a visual touch. Whether it's in documents, presentations, applications, or on your website, let everyone know you trust and use DBLab.

HTML snippet for lighter backgrounds:

powered by dle for light background

<a href="http://databaselab.io">
  <img width="400" src="https://postgres.ai/assets/powered-by-dle-for-light-background.svg" />
</a>

For darker backgrounds:

powered by dle for dark background

<a href="http://databaselab.io">
  <img width="400" src="https://postgres.ai/assets/powered-by-dle-for-dark-background.svg" />
</a>

Propose an idea or report a bug

For proposals, bug reports, and participation in development, see our Contributing Guide.

Reference guides

How-to guides

You can find more in the "How-to guides" section of the documentation.

Miscellaneous

License

The DBLab source code is licensed under the OSI-approved open source license Apache 2.0.

Reach out to the PostgresAI team if you want a trial or commercial license that does not contain the GPL clauses: Contact page.

Community & Support

Contributor Covenant

Many thanks to our amazing contributors!

image

Translations

Making DBLab more accessible to engineers around the globe is a great help for the project. Check details in the translation section of contributing guide.

This README is available in the following translations:

👉 How to make a translation contribution

Releases

Security

Engine: trim Docker runtime image payloads to reduce CVE surface (!1144, #709) CE UI: bump uuid and marked to fix dependency CVEs (!1142)

Full diff Diff between versions 4.1.2 and 4.1.3

Apr 29, 2026

Download .zip

Security

CE UI: refresh Alpine packages in run stage to clear OS CVEs (!1141)

Full diff Diff between versions 4.1.1 and 4.1.2

Apr 24, 2026

Download .zip

New Features

Auto-detect parallelism for pg_dump and pg_restore based on RDS/Aurora instance type in the logical refresh component (!1133) Expose logicalRestore configs in config projection and UI (!...

Apr 7, 2026

DBLab Engine v4.1.0

Download .zip

New Features

Teleport integration (available in Standard and Enterprise Editions only): new dblab teleport serve CLI command and hostssl cert in default pg_hba (!1105) RDS/Aurora logical refresh comp...

Feb 24, 2026

DBLab Engine v4.0.4

Download .zip

Security

Updated pgtype to v1.14.4 to address CVE-2024-27304 (!1086)

Bug Fixes

Fixed config page losing shared_preload_libraries value on reload when using SE images (!1085) Fixed logical snapshot...