|
| 1 | +--- |
| 2 | +authors: [nik, bogdan] |
| 3 | +date: 2026-04-08 00:00:00 |
| 4 | +publishDate: 2026-04-08 00:00:00 |
| 5 | +linktitle: "DBLab 4.1: protection leases, Teleport, Prometheus, and more" |
| 6 | +title: "DBLab 4.1: protection leases, Teleport, Prometheus, and more" |
| 7 | +weight: 0 |
| 8 | +image: /assets/thumbnails/dblab-4.0-blog.png |
| 9 | +tags: |
| 10 | + - Product announcements |
| 11 | + - DBLab Engine |
| 12 | + - Database Lab Engine |
| 13 | +--- |
| 14 | + |
| 15 | +import { BlogFooter } from '@site/src/components/BlogFooter' |
| 16 | +import { nik } from '@site/src/config/authors' |
| 17 | + |
| 18 | +DBLab Engine 4.1 is a release focused on making database branching safer, more convenient, and ready for enterprise adoption. Whether you are a solo developer running DBLab on a MacBook or a platform team managing clones for hundreds of engineers, this release has something for you. |
| 19 | + |
| 20 | +<!--truncate--> |
| 21 | + |
| 22 | +The 4.0 release introduced instant database branching with O(1) economics. With 4.1, we are strengthening the foundation: better resource governance, enterprise-grade access control, production-safe data refresh, and observability that lets you sleep at night. |
| 23 | + |
| 24 | +## Protection leases: safe resource management |
| 25 | + |
| 26 | +This is the headline quality-of-life improvement. In previous versions, a protected clone stayed protected forever -- even if nobody was using it. Forgotten protected clones would quietly consume disk and compute, becoming a problem for the entire team. |
| 27 | + |
| 28 | +DBLab 4.1 introduces **protection leases** -- time-limited protection that expires automatically. |
| 29 | + |
| 30 | +### How it works |
| 31 | + |
| 32 | +When creating a clone, you can now specify a protection duration: |
| 33 | + |
| 34 | +```bash |
| 35 | +# Create a clone protected for 24 hours |
| 36 | +dblab clone create \ |
| 37 | + --branch main \ |
| 38 | + --id my-experiment \ |
| 39 | + --protected 1440 \ |
| 40 | + --username postgres \ |
| 41 | + --password secret |
| 42 | +``` |
| 43 | + |
| 44 | +A background process checks leases every 5 minutes. When a lease expires: |
| 45 | +1. The clone's protection is automatically lifted |
| 46 | +2. A `clone_protection_expired` webhook fires (so your automation knows) |
| 47 | +3. The clone becomes subject to normal idle cleanup rules |
| 48 | + |
| 49 | +If the clone is still being actively used, it stays alive. If it has been sitting idle, it gets cleaned up -- exactly as it should be. |
| 50 | + |
| 51 | +### Configuration |
| 52 | + |
| 53 | +Three new options in the `cloning` section give administrators full control: |
| 54 | + |
| 55 | +```yaml |
| 56 | +cloning: |
| 57 | + # Default lease when a user creates a protected clone without specifying duration |
| 58 | + protectionLeaseDurationMinutes: 1440 # 24 hours |
| 59 | + |
| 60 | + # Hard cap -- no clone can be protected longer than this |
| 61 | + protectionMaxDurationMinutes: 10080 # 7 days |
| 62 | + |
| 63 | + # Send a webhook warning before protection expires |
| 64 | + protectionExpiryWarningMinutes: 1440 # 24 hours before |
| 65 | +``` |
| 66 | +
|
| 67 | +### Why it matters |
| 68 | +
|
| 69 | +This solves a real operational pain point. In teams with dozens of developers and CI pipelines, forgotten clones are inevitable. Protection leases let users mark important work as protected while giving platform teams the guarantee that resources will be reclaimed. No more "who left this clone running for three weeks?" conversations. |
| 70 | +
|
| 71 | +The warning webhooks also integrate naturally with Slack or PagerDuty -- remind the owner before their clone expires so they can extend the lease if needed. |
| 72 | +
|
| 73 | +## Database rename |
| 74 | +
|
| 75 | +When cloning production data for development, you often don't want the production database name showing up in your test environments. DBLab 4.1 adds native database renaming during snapshot creation. |
| 76 | +
|
| 77 | +```yaml |
| 78 | +# In your DBLab configuration |
| 79 | +physicalSnapshot: |
| 80 | + options: |
| 81 | + databaseRename: |
| 82 | + myapp_production: myapp_dev |
| 83 | + analytics_prod: analytics_dev |
| 84 | +``` |
| 85 | +
|
| 86 | +During snapshot creation, DBLab executes `ALTER DATABASE ... RENAME TO ...` in a temporary container, so every clone created from that snapshot already has the sanitized names. This works in both physical and logical modes. |
| 87 | + |
| 88 | +### Use cases |
| 89 | + |
| 90 | +- **Environment isolation**: Prevent accidental connections to the wrong database by giving dev/staging clones distinct names |
| 91 | +- **Convention enforcement**: Your application configs can use consistent names (`myapp_dev`) across all environments |
| 92 | +- **Compliance**: Eliminate production identifiers from non-production environments |
| 93 | + |
| 94 | +Validation is thorough -- DBLab checks for empty names, circular renames, self-renames, and conflicts with the connection database, so misconfigurations are caught early. |
| 95 | + |
| 96 | +## ARM64 and Colima support |
| 97 | + |
| 98 | +DBLab Engine now runs natively on Apple Silicon. If you're on an M1, M2, M3, or M4 Mac, you can run full database branching locally using [Colima](https://github.com/abiosoft/colima) as the container runtime. |
| 99 | + |
| 100 | +### Getting started on macOS |
| 101 | + |
| 102 | +```bash |
| 103 | +# Start Colima and initialize ZFS |
| 104 | +colima start --cpu 4 --memory 8 --disk 60 |
| 105 | +colima ssh < engine/scripts/init-zfs-colima.sh |
| 106 | +
|
| 107 | +# Build ARM64 binary |
| 108 | +GOOS=linux GOARCH=arm64 make build |
| 109 | +
|
| 110 | +# Build ARM64 Postgres image |
| 111 | +docker build -t dblab-postgres:17-arm64 -f Dockerfile.arm64 . |
| 112 | +``` |
| 113 | + |
| 114 | +The setup guide covers everything from ZFS pool creation inside the Colima VM to volume mount propagation for ZFS clones. |
| 115 | + |
| 116 | +### Why it matters |
| 117 | + |
| 118 | +This unlocks a fully offline development workflow. You can now run DBLab on a plane, in a secure facility, or anywhere you don't have cloud access. For teams evaluating DBLab, the barrier to trying it drops to zero -- just `colima start` and go. |
| 119 | + |
| 120 | +It also means DBLab works on the hardware most developers already have. No need to provision a cloud VM just to experiment with database branching. |
| 121 | + |
| 122 | +## Teleport integration (Standard and Enterprise editions) |
| 123 | + |
| 124 | +For teams using [Teleport](https://goteleport.com/) for infrastructure access, DBLab 4.1 adds native integration. When a clone is created, it is automatically registered as a Teleport database resource. When it is destroyed, the resource is cleaned up. |
| 125 | + |
| 126 | +### Architecture |
| 127 | + |
| 128 | +DBLab uses a sidecar model: |
| 129 | + |
| 130 | +``` |
| 131 | +Developer → tsh db connect → Teleport Proxy → Teleport DB Agent → DBLab Clone |
| 132 | + ↑ |
| 133 | +DBLab Engine ──webhook──► Teleport Sidecar ──tctl──► Teleport Auth |
| 134 | +``` |
| 135 | + |
| 136 | +The sidecar (`dblab teleport serve`) listens for webhook events and manages Teleport resources via `tctl`. A separate Teleport Database Agent handles connection proxying with full certificate-based authentication. |
| 137 | + |
| 138 | +### What you get |
| 139 | + |
| 140 | +- **Automatic resource lifecycle**: No manual registration of database resources. Clones appear and disappear in Teleport automatically |
| 141 | +- **Certificate-based auth**: DBLab 4.1 includes `hostssl all all 0.0.0.0/0 cert` in the default `pg_hba.conf`, so Teleport connections work out of the box |
| 142 | +- **Startup reconciliation**: If the sidecar restarts, it reconciles any missed events within 5 minutes |
| 143 | +- **Audit trail**: Every clone connection goes through Teleport, giving you a complete access log |
| 144 | + |
| 145 | +### Why it matters |
| 146 | + |
| 147 | +In regulated environments -- finance, healthcare, government -- you need auditable access control for every database, even ephemeral ones. Teleport integration means DBLab clones inherit your organization's access policies, role-based permissions, and session recording. This makes database branching viable in environments where "just give them the password" is not an option. |
| 148 | + |
| 149 | +:::note |
| 150 | +Teleport integration is available in Standard Edition (SE) and Enterprise Edition (EE) only. |
| 151 | +::: |
| 152 | + |
| 153 | +## RDS/Aurora logical refresh without production impact |
| 154 | + |
| 155 | +Running `pg_dump` directly against a production RDS or Aurora instance is risky. It holds the `xmin` horizon for the entire duration of the dump, which can cause bloat accumulation, degrade vacuum effectiveness, and create load on the primary. |
| 156 | + |
| 157 | +DBLab 4.1 ships a dedicated `rds-refresh` tool that eliminates this problem entirely. |
| 158 | + |
| 159 | +### How it works |
| 160 | + |
| 161 | +``` |
| 162 | +Production ──RDS snapshot──► Snapshot ──restore──► Temporary RDS clone ──pg_dump──► DBLab |
| 163 | + │ |
| 164 | + (auto-deleted) |
| 165 | +``` |
| 166 | +
|
| 167 | +Instead of dumping from production, the tool: |
| 168 | +1. Finds the latest RDS automated snapshot |
| 169 | +2. Creates a temporary RDS clone from that snapshot |
| 170 | +3. Runs `pg_dump` against the temporary clone |
| 171 | +4. Feeds the data into DBLab's logical refresh pipeline |
| 172 | +5. Deletes the temporary clone -- even if something fails |
| 173 | +
|
| 174 | +The temporary clone costs roughly $0.35-$1.20 for a typical 2-5 hour refresh window (using `db.t3.medium` to `db.r5.large`). |
| 175 | +
|
| 176 | +### Safety features |
| 177 | +
|
| 178 | +The tool has multiple layers of orphan protection: |
| 179 | +- **Defer cleanup**: The temporary clone is always deleted on exit |
| 180 | +- **Signal handlers**: Catches SIGINT, SIGTERM, and SIGHUP to clean up on interruption |
| 181 | +- **State file**: Tracks the active clone so it can be recovered after crashes |
| 182 | +- **Tag scanning**: Finds orphaned clones by the `ManagedBy=dblab-rds-refresh` tag |
| 183 | +- **Manual cleanup**: `rds-refresh cleanup --max-age 48h` finds and removes stale clones |
| 184 | +
|
| 185 | +### Configuration |
| 186 | +
|
| 187 | +```yaml |
| 188 | +source: |
| 189 | + type: rds # or "aurora-cluster" |
| 190 | + identifier: my-production-db |
| 191 | +
|
| 192 | +clone: |
| 193 | + instanceClass: db.t3.medium |
| 194 | + securityGroups: |
| 195 | + - sg-0123456789abcdef0 |
| 196 | + subnetGroup: my-db-subnet-group |
| 197 | +
|
| 198 | +refresh: |
| 199 | + timeout: 4h |
| 200 | +
|
| 201 | +dblab: |
| 202 | + url: https://dblab.internal:2345 |
| 203 | + token: your-dblab-token |
| 204 | +``` |
| 205 | + |
| 206 | +Scheduling is supported via cron, Kubernetes CronJob, or ECS Scheduled Task. |
| 207 | + |
| 208 | +### Why it matters |
| 209 | + |
| 210 | +This is essential for any team running on RDS or Aurora. You get fresh production data in your DBLab instance without touching the primary at all. No bloat accumulation, no load impact, no risk. Combined with DBLab's instant cloning, your developers and CI pipelines always work with recent production-like data. |
| 211 | + |
| 212 | +## Prometheus metrics exporter |
| 213 | + |
| 214 | +DBLab 4.1 exposes a comprehensive `/metrics` endpoint in Prometheus format -- no authentication required, ready to scrape. |
| 215 | + |
| 216 | +### What's exposed |
| 217 | + |
| 218 | +| Category | Key metrics | |
| 219 | +|----------|------------| |
| 220 | +| **Instance** | Uptime, health status (0=OK, 1=Warning, 2=Bad), edition | |
| 221 | +| **Disk** | Total/free/used bytes, compression ratio, data directory size | |
| 222 | +| **Clones** | Total count, count by status, max age, CPU/memory usage, protected count | |
| 223 | +| **Snapshots** | Total count, max age, physical/logical size, data lag | |
| 224 | +| **Sync instance** | WAL lag (seconds), uptime, last replayed timestamp | |
| 225 | + |
| 226 | +### Setup |
| 227 | + |
| 228 | +```yaml |
| 229 | +# prometheus.yml |
| 230 | +scrape_configs: |
| 231 | + - job_name: 'dblab' |
| 232 | + static_configs: |
| 233 | + - targets: ['dblab-host:2345'] |
| 234 | + metrics_path: /metrics |
| 235 | +``` |
| 236 | +
|
| 237 | +### Example alerts |
| 238 | +
|
| 239 | +The [documentation](https://github.com/postgres-ai/database-lab-engine/blob/master/PROMETHEUS.md) includes ready-to-use alert rules: |
| 240 | +
|
| 241 | +- **Low disk space**: Fire when free disk drops below 20% |
| 242 | +- **Stale snapshots**: Fire when the newest snapshot is older than 24 hours |
| 243 | +- **High clone count**: Fire when more than 50 clones are active |
| 244 | +- **WAL replay lag**: Fire when the sync instance falls more than 1 hour behind (physical mode) |
| 245 | +- **Sync instance down**: Fire when the sync instance is unreachable |
| 246 | +
|
| 247 | +### OpenTelemetry support |
| 248 | +
|
| 249 | +For teams using different observability stacks, DBLab includes an [OpenTelemetry Collector configuration example](https://github.com/postgres-ai/database-lab-engine/blob/master/engine/configs/otel-collector.example.yml) that can export metrics to Grafana Cloud, Datadog, New Relic, AWS CloudWatch, or any OTLP-compatible backend. |
| 250 | +
|
| 251 | +### Why it matters |
| 252 | +
|
| 253 | +Until now, monitoring DBLab required checking the API manually or building custom integrations. With native Prometheus support, DBLab fits into your existing monitoring stack with zero effort. You get visibility into disk usage trends, clone proliferation, snapshot freshness, and replication lag -- the metrics that matter most for keeping your database branching infrastructure healthy. |
| 254 | +
|
| 255 | +## Summary of changes |
| 256 | +
|
| 257 | +| Feature | Benefit | Availability | |
| 258 | +|---------|---------|-------------| |
| 259 | +| **Protection leases** | Automatic cleanup of forgotten clones | All editions | |
| 260 | +| **Database rename** | Sanitized database names in clones | All editions | |
| 261 | +| **ARM64 / Colima** | Run DBLab on Apple Silicon Macs | All editions | |
| 262 | +| **Teleport integration** | Auditable access control for clones | SE and EE | |
| 263 | +| **RDS/Aurora refresh** | Production-safe data refresh | All editions | |
| 264 | +| **Prometheus exporter** | Native observability | All editions | |
| 265 | +
|
| 266 | +## Where to start |
| 267 | +
|
| 268 | +1. **Try the demo**: [demo.dblab.dev](https://demo.dblab.dev) (token: `demo-token`) |
| 269 | +2. **Deploy DBLab SE**: [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-wlmm2satykuec) or [Postgres.ai Console](https://console.postgres.ai) |
| 270 | +3. **Install open source**: [How-to](https://postgres.ai/docs/dblab-howtos/administration/install-dle-manually) |
| 271 | +4. **macOS setup**: [Run DBLab on Mac](/docs/dblab-howtos/administration/run-database-lab-on-mac) |
| 272 | +5. **Enterprise inquiries**: Contact [team@postgres.ai](mailto:team@postgres.ai) for DBLab EE |
| 273 | + |
| 274 | +--- |
| 275 | + |
| 276 | +DBLab 4.1 makes database branching production-ready at every scale. Protection leases keep your infrastructure clean. Teleport keeps access auditable. The Prometheus exporter keeps you informed. And RDS refresh keeps your data fresh without putting production at risk. All of this on top of the O(1) economics that make DBLab unique. |
| 277 | + |
| 278 | +[Get Started](https://postgres.ai/docs/database-lab) | [GitHub](https://github.com/postgres-ai/database-lab-engine) | [Join our Slack](https://slack.postgres.ai) |
| 279 | + |
| 280 | +<BlogFooter author={nik} /> |
0 commit comments