cx-platform-store
the storage engine, its substrates, journal/live/audit, and the store server
Why reach for it
State that outlives the program, addressed by content.
cx-platform-store is the storage engine: a document's handle is
derived from its canonical bytes, the journal is a hash chain, the
live and audit streams read from the same log, full-text search sits
beside it, and the served store answers the same two calls as an
in-memory one.
Content addressing is the model (store): put-doc answers a
handle computed from the canonical form, so the same document put
twice is one document, and a handle is a fact about bytes rather than
a row number. The journal appends entries whose prev-hash names the
entry before, so a chain that verifies is a history nobody edited
(event-evolution, consistency).
mem:// needs no grant and is the store every example on this site
runs against; a real URL talks to cx store-serve, the daemon
described on the operations page, with the same calls. The
substrates, the transports, encryption at rest and the management
console are the store page's chapters; the three streams —
journal, live, audit — are the modules below.
What it gives you
Five modules: the engine, its journal, its live and audit streams, and
full-text search — ft is a Ring 1 module of this repository, the
rest are the platform group's. Each links to the reference page the
guide projects from the module's own documentation.
| module | import it as | where it lives | reference |
|---|---|---|---|
audit
|
[?lib 'cx-platform/audit']
|
Ring 1 · the platform group | audit reference |
journal
|
[?lib 'cx-platform/journal']
|
Ring 1 · the platform group | journal reference |
live
|
[?lib 'cx-platform/live']
|
Ring 1 · the platform group | live reference |
store
|
[?lib 'cx-platform/store']
|
Ring 1 · the platform group | store reference |
Try it
Two appends to an in-memory journal, then the second entry read back:
its prev-hash is the first entry's hash, its own hash covers the
payload, and the event rides inside it unchanged.
prog.cx
[?lib 'cx-platform/journal']
[?let [= $j [$journal:open "mem://t" "acme"]]
[= $e1 [$journal:append $j [a 1] {actor: "u" authority: "g"}]]
[= $e2 [$journal:append $j [b 2] {actor: "u" authority: "g"}]]
[$journal:read $j 2]]
$ cx prog.cx
[entry seq=2 tenant=acme actor=u authority=g ts='1970-01-01T00:00:02Z' prev-hash='sha2-256:69c69761d531660401aa7275810f13828b1db1430511243efbaddc053637311d' payload=sha2-256:e74783796d0d83dfce07552c3773cc9ab4f270fbeb19ada5438a363d79b08e18 hash='sha2-256:1d4f5830f65cd9c6b37aa82309376cb3933b6ff91b7d0c7ef877d4403c9dabb0' [event [b 2]]]
Fixture journal-002-chain-link in deps/cx-platform-store/conformance/platform/journal.cxd — replayed against this cx when the page was built.
Status
The storage engine builds on the language, the wire and the session layer, and is built on by the identity repository and the application host; the front door compiles its V module from the pin.
| fact | as the registry records it |
|---|---|
| ships as |
binary
|
| status | extracted |
| pinned at |
2b5b3c0c2
|
| builds on | cx-core-code, cx-platform-net, cx-platform-xsp |
| built on by | cx-platform-identity, cx-platform-fabric, cx-platform-xap, cx-platform-flow, cx-platform-connector, cx-platform-secrets, cx-platform-sso, cx-platform-agent |
| bundled modules | 4 |
cx-platform-store plugs into: the repositories it builds on (left), the modules it ships (centre), the repositories that build on it (right) · drawn from registry/repos.cxd, deps.cxd and registry/modules.cxd when this page was builtLinks
- github.com/cx-home/cx-platform-store — the repository
- README — what it is, how to install it, what it pins
-
spec/03-approved— the specification, the only truth -
spec/03-approved/platform— the specification, the only truth -
conformance— the conformance corpus, the executable truth -
conformance/platform— the conformance corpus, the executable truth