Skip to content
use-cases / branch-computers-like-git / hero
SNAPSHOTS · BUILD DEV ENVIRONMENTS

Branch computers like Git branches code

A snapshot freezes a running container — filesystem, processes, memory, open file descriptors. Restore in 5–15 seconds. Fork into a separate container with one POST. Branching, but for the entire machine.

Snapshot docs
use-cases / branch-computers-like-git / capture

What actually gets captured

Two modes, decided by the container's state at snapshot time. Stateful captures everything; stateless is filesystem only.

WHEN RUNNINGcreate 1–5 s · restore 5–15 s

Stateful — running container

  • Filesystem (CoW delta)BTRFS reflinks; later snapshots store only changed blocks.
  • Process treeLong-running daemons resume mid-execution, not from boot.
  • Memory stateHeap, stack, mmaps. ~4 GB extra disk for the RAM dump.
  • Open file descriptorsLocal sockets and FDs survive; remote peers do not.
  • Terminal scrollbackLive tmux/screen sessions resume mid-line.
WHEN STOPPEDcreate 1–5 s · cold start 5–15 s

Stateless — stopped container

  • Filesystem (CoW delta)Same incremental storage model as stateful.
  • Process treeContainer starts fresh from the captured filesystem.
  • Memory stateNo RAM is dumped — saves disk and time.
  • Open file descriptorsReopened by the new processes on cold start.
  • Database filesPostgres / SQLite recover from the captured WAL.
use-cases / branch-computers-like-git / branch

Branching is one HTTP call

Snapshots are named alias points. /copy spins up a separate container from any of them — same data, divergent timeline.

iterm
# 1) Mark the branch point.
curl -X POST "https://api.hoody.com/api/v1/containers/$CID/snapshots" \
  -H "Authorization: Bearer $HOODY_TOKEN" \
  -d '["alias": "pre-migration", "expiry": 30]'

# 2) Restore in place — revert this container to the snapshot.
curl -X PATCH "https://api.hoody.com/api/v1/containers/$CID/snapshots/pre-migration" \
  -H "Authorization: Bearer $HOODY_TOKEN"

# 3) Fork — spawn a SEPARATE container from the same snapshot.
curl -X POST "https://api.hoody.com/api/v1/containers/$CID/copy" \
  -H "Authorization: Bearer $HOODY_TOKEN" \
  -d '["target_project_id":"prod","name":"experiment-a","source_snapshot":"pre-migration"]'

Restore reverts in place. Copy creates an independent container that lives on its own — different ID, different timeline, your original keeps running. Either way it's bounded; storage is incremental, so cheap.

Restore flowRestore window · 5 to 15 seconds
0110:00Snapshot taken
0210:14Migration explodes
0310:14:08Restored
use-cases / branch-computers-like-git / powers

What the branch model unlocks

Three workflows that were impractical with VM snapshots and impossible with docker commit.

  1. 01

    Parallel experiments

    Spawn N containers from the same snapshot via /copy — try three migration strategies in parallel, keep the winner.

  2. 02

    Pre-flight every risky deploy

    POST a snapshot before any destructive change. The seven-second restore is your undo button for the entire machine.

  3. 03

    Durable timeline

    Aliases are named branch points. snapshot_count is in the container API. Storage is incremental, so cheap to keep dozens.

use-cases / branch-computers-like-git / replaces

What this replaces

If you reach for any of these to recover from a bad change, the snapshot model is doing the same job in 5–15 seconds with one HTTP call.

  • vm-snapshotsMinutes to take, GBs of disk per snapshot
  • vagrantLocal boxes, no shared state, no remote restore
  • docker commitFilesystem only, no processes / no memory
  • manual backupsrsync + a wiki page nobody reads
  • pg_dump cyclesDB only, leaves the rest of the box mid-bad-state
  • rebuild from scratch30+ minutes, breaks your editor session
use-cases / branch-computers-like-git / cta

Git gave you branching for code. Hoody gives you branching for entire computers.

use-cases / branch-computers-like-git / related

Read the others