datamuta

Database migration that proves what it did.

Datamuta is an experimental Rust runtime. It seals a source snapshot to disk, publishes only the plan you approved by hash, commits a receipt with every partition, and checks the values that landed.

Experimental. Not for production data. PostgreSQL → PostgreSQL is the documented path.

Capture a snapshot, then let the source go.

Datamuta reads a flat, typed snapshot in bounded pages. PostgreSQL capture blocks source writes until it finishes. After that, publication needs only the sealed spool and the destination; the source can be offline.

datamuta-stream capture --config config.json --spool snapshot --plan plan.json

Every field is assigned exactly once.

The mapping is explicit: copies, renames and lossless i32 → i64 widening. Unsupported conversions, nullable-to-required mappings and reordered identities are refused before any data moves.

mapping.json · version 1 · 4 fields

Data is sealed into partitions on disk.

Records are encoded into partitions of at most 256 rows and 1 MiB, bound by partition hashes and Merkle proofs. The spool has a hard budget: 256 MiB by default, 4 GiB at most.

snapshot/ · sealed manifest · partition hashes

Inspection grants nothing. The hash does.

Engines, endpoints, schemas, mapping, the implementation fingerprint and the snapshot are bound into one plan. run refuses to start without the exact hash you reviewed.

datamuta-stream run --plan plan.json --spool snapshot --approved-plan-sha256 HASH

Each partition commits with its own receipt.

A partition's records, receipt and cursor commit atomically in the destination. Resume reads that native evidence, and a timeout is never taken as proof of rollback.

datamuta-stream status --plan plan.json --spool snapshot

Progress is not correctness. Values are.

Verification reads what is stored in the destination and compares it with the transformed, authenticated spool. A clean exit or an intact receipt chain does not replace it.

datamuta-stream verify --plan plan.json --spool snapshot --out verification.json

Three rows, start to finish.

Two disposable PostgreSQL 17 containers on loopback ports 55432 and 55433, invented data, and the commands from the pipeline above. You need Docker Compose and Rust 1.99 or newer.

Replace HASH with the plan_sha256 that inspect prints, after you have read the plan.

Full walkthrough in examples/postgres
examples/postgres
# two loopback databases, three synthetic rows
docker compose --project-name datamuta-example up --detach --wait
umask 077 && mkdir work && cd work

datamuta-stream configure \
  --source-endpoint ../source-endpoint.json --source-table orders \
  --target-endpoint ../target-endpoint.json --target-table purchases \
  --mapping ../mapping.json --out config.json
datamuta-stream capture --config config.json --spool snapshot --plan plan.json
datamuta-stream inspect --plan plan.json --spool snapshot

# publish only the plan you reviewed
datamuta-stream run --plan plan.json --spool snapshot --approved-plan-sha256 HASH
datamuta-stream status --plan plan.json --spool snapshot
datamuta-stream verify --plan plan.json --spool snapshot --out verification.json
verification.json status "verified" rows_verified 3 fields_verified 12

Meaning is mapped, not inferred.

The example moves dm_source.orders into dm_target.purchases. The identity widens from integer to bigint, and every value arrives as it left. All rows are synthetic.

ordersoperationpurchases
order_id integer · keywiden_i32_to_i64order_key bigint · key
cents bigintcopyvalue bigint
note text · nullablecopymemo text · nullable
active booleancopyenabled boolean
dm_target.purchases after verify
order_keyvaluememoenabled
112500Synthetic example ordertrue
2-750NULLfalse
30Unicode example: 雪🦀true
  • NULL stays null; it never becomes an empty string.
  • -750 and 0 keep their sign and precision.
  • 雪🦀 arrives as the same UTF-8.

Two valid mappings? Ask Jev, then decide.

When the types allow more than one mapping, for example two bigint amounts, suggest-mapping lists every valid option and asks Jev, TypeSafe's decision model, to pick one from the field meanings you write.

Jev can only choose from that closed list or answer review. A pick is accepted only at probability ≥ 0.90 with a lead of ≥ 0.20, and the result is still a draft: the plan hash approval is unchanged.

How to use suggest-mapping
suggest-mapping ask
# key stays in the environment; one call, no retries
export DATAMUTA_JEV_API_KEY=...
datamuta-stream suggest-mapping ask \
  --source-endpoint src.json --source-table billing \
  --target-endpoint tgt.json --target-table invoices \
  --evidence evidence.json \
  --request-out request.json --response-out response.json \
  --mapping-out mapping.json --provenance-out mapping.provenance.json
Live runs against jev-1.14.0, synthetic schema
Field meaningsJev's pickOutcome
Clearcorrect · p 1.00accepted
Vague (“an amount”)correct · p 0.77sent to review
Injected instructioncorrect · p 0.99accepted, injection ignored

Where it runs today.

Adapter code exists for four engines. Only PostgreSQL has a complete documented example; the others are laboratory profiles, and their presence is not a support promise.

EngineCapturePublishReadiness
PostgreSQLComplete documented example on a restricted PostgreSQL 17 profile. Still experimental.
MySQLLaboratory loopback profile, restricted InnoDB tables.
MongoDBLaboratory loopback replica set, restricted flat documents.
FirestoreLocal emulator only, prescribed flat collection and identity format.

Bounds you can read before you run.

These are admission limits enforced by the runtime, not throughput promises or disk reservations.

Full limits in the operations book
Encoded record
≤ 65,536 bytes
Partition
≤ 256 rows · ≤ 1 MiB
Partitions per job
≤ 65,536
Spool
8 KiB – 4 GiB · default 256 MiB
Command deadline
300 s
Types
bool · i32 · i64 · UTF-8 · null

Not in this release

  • Change data capture
  • Cutover and rollback
  • Decimals, timestamps, arrays, binary
  • Nested transformations and joins
  • Upserts into existing data
  • Petabyte-scale execution
  • Hosted service

Read the plan. Approve the hash. Check the values.

git clone https://github.com/copyleftdev/datamuta
cd datamuta/examples/postgres