HeadlinesBriefing favicon HeadlinesBriefing.com

Building PlanetScale at Home

Hacker News •
×

The author is developing "Homescale," a project inspired by PlanetScale, designed to create writable database instances and point-in-time branches from immutable snapshots without full data copying. This approach isolates storage from compute, utilizing a model similar to Docker's image and container system. A database image serves as an immutable starting point, a container is a writable clone, and a branch is another container derived from an existing one.

Homescale aims to be database-agnostic, supporting engines that store durable state on a filesystem backed by a block device. Initially, Postgres will be the primary engine, with engine-specific behavior handled by an adapter. The core functionality relies on Copy-on-Write (COW) in the storage layer, allowing branches to share unchanged data and only store modifications, thus avoiding large upfront storage costs for clones.

This architecture separates database storage from compute, enabling compute instances to be replaced or scaled without duplicating data. For persistence, Homescale leverages technologies like Ceph's RADOS Block Device (RBD), which provides persistent block devices, immutable snapshots, and writable COW clones. RBD images act as virtual block devices, and their snapshots offer read-only views at specific points in time, forming the foundation for Homescale's branching mechanism.