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.
*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](https://gitlab.com/postgres-ai/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.

Try it yourself right now:
- Visit [Postgres.ai Console](https://console.postgres.ai/), set up your first organization, and provision a DBLab Standard Edition (DBLab SE) to any cloud or on-premises environment.
- [Pricing](https://postgres.ai/pricing) (starting at $62/month)
- [Documentation: How to install DBLab SE](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-postgres-ai)
- Demo: https://demo.dblab.dev (use the token `demo-token` to access)
- Looking for a free version? Install the DBLab Community Edition by [following this tutorial](https://postgres.ai/docs/tutorials/database-lab-tutorial).
## How it works
Thin cloning is fast because it is based on [Copy-on-Write (CoW)](https://en.wikipedia.org/wiki/Copy-on-write#In_computer_storage). DBLab employs two technologies for enabling thin cloning: [ZFS](https://en.wikipedia.org/wiki/ZFS) (default) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)).
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:
- [How it works](https://postgres.ai/products/how-it-works)
- [Database Migration Testing](https://postgres.ai/products/database-migration-testing)
- [SQL Optimization with Joe Bot](https://postgres.ai/products/joe)
- [Questions and answers](https://postgres.ai/docs/questions-and-answers)
## Where to start
- [DBLab tutorial for any PostgreSQL database](https://postgres.ai/docs/tutorials/database-lab-tutorial)
- [DBLab tutorial for Amazon RDS](https://postgres.ai/docs/tutorials/database-lab-tutorial-amazon-rds)
- [How to install DBLab SE using Postgres.ai Console](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-postgres-ai)
- [How to install DBLab SE using AWS Marketplace](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-aws-marketplace)
## Case studies
- GitLab: [How GitLab iterates on SQL performance optimization workflow to reduce downtime risks](https://postgres.ai/resources/case-studies/gitlab)
## Features
- Speed & scale
- Blazing-fast cloning of PostgreSQL databases – clone in seconds, irrespective of database size
- Theoretical max of snapshots/clones: 2
64 ([ZFS](https://en.wikipedia.org/wiki/ZFS), default)
- Maximum size of PostgreSQL data directory: 256 quadrillion zebibytes, or 2
128 bytes ([ZFS](https://en.wikipedia.org/wiki/ZFS), default)
- Support & technologies
- Supported PostgreSQL versions: 10–18
- Thin cloning ([CoW](https://en.wikipedia.org/wiki/Copy-on-write)) technologies: [ZFS](https://en.wikipedia.org/wiki/ZFS) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux))
- 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](https://postgres.ai/docs/database-lab/supported-databases#extensions-included-by-default))
- Customization capabilities for containers ([docs](https://postgres.ai/docs/database-lab/supported-databases#how-to-add-more-extensions))
- 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
- 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
- Snapshot retention policies in DBLab configuration
- Clones
- "Deletion protection" for preventing clone deletion
- 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](https://api.dblab.dev))
- Prometheus metrics endpoint (`/metrics`) for monitoring
- Netdata module for insights
### Spread the word
- Tweet about DBLab and mention [@Database_Lab](https://twitter.com/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:
For darker backgrounds:
### Propose an idea or report a bug
### Reference guides
- [DBLab components](https://postgres.ai/docs/reference-guides/database-lab-engine-components)
- [Client CLI reference](https://postgres.ai/docs/database-lab/cli-reference)
- [DBLab API reference](https://api.dblab.dev/)
- [DBLab configuration reference](https://postgres.ai/docs/database-lab/config-reference)
### How-to guides
- [How to install and initialize Database Lab CLI](https://postgres.ai/docs/how-to-guides/cli/cli-install-init)
- [How to manage DBLab](https://postgres.ai/docs/how-to-guides/administration)
- [How to work with clones](https://postgres.ai/docs/how-to-guides/cloning)
- [How to work with branches](https://postgres.ai/docs/dblab-howtos/branching)
- How to integrate DBLab with GitHub Actions – TBD
- How to integrate DBLab with GitLab CI/CD – TBD
You can find more in the ["How-to guides" section](https://postgres.ai/docs/how-to-guides) of the documentation.
### Miscellaneous
- [DBLab Docker images](https://hub.docker.com/r/postgresai/dblab-server)
- [Extended Docker images for PostgreSQL (with plenty of extensions)](https://hub.docker.com/r/postgresai/extended-postgres)
- [SQL Optimization chatbot (Joe Bot)](https://postgres.ai/docs/joe-bot)
- [DB Migration Checker](https://postgres.ai/docs/db-migration-checker)
## License
The DBLab source code is licensed under the OSI-approved open source license [Apache 2.0](https://opensource.org/license/apache-2-0/).
Reach out to the Postgres.ai team if you want a trial or commercial license that does not contain the GPL clauses: [Contact page](https://postgres.ai/contact).
## Translations
This README is available in the following translations:
- [German / Deutsch](translations/README.german.md) (by [@ane4ka](https://github.com/ane4ka))
- [Brazilian Portuguese / Português (BR)](translations/README.portuguese-br.md) (by [@Alexand](https://gitlab.com/Alexand))
- [Russian / Русский](translations/README.russian.md) (by [@Tanya301](https://github.com/Tanya301))
- [Spanish / Español](translations/README.spanish.md) (by [@asotolongo](https://gitlab.com/asotolongo))
- [Ukrainian / Українська](translations/README.ukrainian.md) (by [@denis-boost](https://github.com/denis-boost))