A fork creates a new database that duplicates an existing one at a transaction basis. The result is a sandbox wound back to a point in time.
Use a fork to debug against real data, or to try an alternative approach, without touching the original.
Unlike backup and restore, forking is online. It runs against the live transactor through the catalog service.
corium db fork people people-debug --as-of 1234
corium db fork people people-scratch
Without --as-of, the fork is taken at the current basis.
The command prints one EDN map:
{:db "people-debug" :forked-from "people" :basis-t 1234 :created true}
The fork copies only the transaction-log prefix through the requested basis.
Every t up to the basis of the source names a transaction, so any value in
range is exact.
Schema metadata is shared. Index segments deduplicate by content address in the blob store, so a fork is cheap in storage.
The new database replays that prefix, publishes its own indexes, and then transacts completely independently of its source.
:created false, and nothing is changed.A read-only view of a point in time does not need a fork. A peer gets one
locally with as-of, at no storage cost.
Fork only when the sandbox must accept writes.
Delete a finished fork like any other database:
corium db delete people-debug
Blobs shared with the source stay reachable from the source root. Garbage collection sweeps only what no live root reaches. See garbage collection.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |