Back to topics

Git-like Branching for PostgreSQL with ZFS Snapshots: Velo and Safe Migrations

1 min read
209 words
Database Debates Git-like Branching

Git-like branching for PostgreSQL? Meet Velo, a Linux + ZFS snapshot tool that forks databases in seconds. A 100GB database branches in ~2 seconds and starts with ~100KB of space, each branch running as a complete, isolated PostgreSQL instance in Docker. It achieves this by checkpointing, snapshotting, cloning, and booting a container. [1]

How it works - It first runs a CHECKPOINT to flush buffers and ensure consistency, then creates a ZFS snapshot and clones it to a new dataset (CoW). A fresh PostgreSQL container is spun up pointing at the clone. [1] - The mental model mirrors Git: a Project is a repo and a Branch is a Git branch; you run commands like velo branch create api/test-migration. [1]

Safe migrations and PITR - Point-in-time recovery uses WAL archiving so you can branch from a timestamp, e.g., five minutes before the incident. [1]

Environment & Open Source - Requirements are Linux + ZFS + Docker. [1] - The project is built with Bun and TypeScript. [1] - Commenters call it open source and a killer feature; one note mentions PlanetScale. [1]

Closing thought: Velo’s Git-inspired branching could make migrations safer and faster to test in real-world Docker/Linus setups. Watch how teams adopt point-in-time branching for DB migrations next.

References

[1]
HackerNews

Show HN: Velo – Git-like branching for PostgreSQL databases using ZFS snapshots

ZFS snapshots clone PostgreSQL quickly; branch, isolate, test migrations; supports point-in-time recovery; Docker and Linux.

View source

Want to track your own topics?

Create custom trackers and get AI-powered insights from social discussions

Get Started