Skip to content

Branches and restore

Both are the same thing underneath: a new database that reads an existing one’s stored history from a chosen point. Nothing is copied, so they are made in seconds whatever the size, and they cost storage only for what is written to them afterwards.

Terminal window
peat branch orders orders-dev

orders-dev is a full database with orders’ data as of now. It has a name and address of its own and uses orders’ login. Writes to either never reach the other. Use it to try a migration, to give a test run real data, or to give each pull request a database.

As an object:

apiVersion: peat.zabaca.com/v1alpha1
kind: Database
metadata:
name: orders-dev
spec:
parent: orders
Terminal window
peat restore orders orders-tuesday --at 2026-12-01T09:30:00Z

This makes a new database, orders-tuesday, as orders was at that moment. orders itself is untouched and keeps running. Look at the restored copy, take from it what you need, or point your application at it.

  • --at is a time in UTC, in the past, written like 2026-12-01T09:30:00Z. It can also be a log position (16/B374D848).
  • The moment must be after the database was made.

As an object, it is a branch with at:

spec:
parent: orders
at: "2026-12-01T09:30:00Z"
Terminal window
peat delete orders-dev --yes

A database that others were made from waits for those to be deleted first. A deleted database’s compute goes at once; its data is removed after the Platform’s databases.deleteHold, and never keeps it.

  • A branch or restore lives in the same namespace as its parent.
  • parent and at cannot be changed once the database is made.
  • A branch of a read replica is refused; branch its primary.