← Back to list

Datomic — Time-Traveling Data, Immutable Semantics

CMCC Compliance Score: 7/10

eejai42 in CMCC Deepdive! · 2025-05-05 19:54 · 0 claps · 5.0 min read
#datomic #cmcc #conceptual-modelling #syntax #abstract-syntax-tree
Open on Medium ↗
Wiki topics: TLS · Design Tools & Workflow LNG · Linguistics & Language ✈️ · Travel

5. Datomic — Time-Traveling Data, Immutable Semantics

CMCC Compliance Score: 7/10

Audience Note: There is a business oriented version of this article here (https://….) but this article is targeted at an expert level audience in these areas.

The Conceptual Model Completeness Conjecture (CMCC) asks a single question: How much of the rulebook for a domain — schema, data, relationships, aggregates, formulas, provenance, and ACID guarantees — can one engine keep inside a single snapshot that is always queryable? A theoretical ten-point champion would fuse a spreadsheet-grade canvas with an extended-Datalog core so that a business user writes a rule once and sees it enforced, versioned, replayed, and moved between back-ends forever. Nobody ships that unicorn today, so ten remains an asymptote.

Datomic is no unicorn, yet it posts a confident 7 / 10. Roughly three-quarters of the conjecture’s ideal already work in production code. This article unpacks the math behind that seven, adds essential purity guardrails, shows how the engine slots into a CMCC workflow, and seeds three pragmatic upgrades for the climb toward eight.

Building the 7 / 10 score

CMCC awards or withholds points in eight observable areas. No tables — just a narrative ledger.

  • Syntax freedom (1 pt). Datomic’s storage and query language are welded to EDN and Datalog. Adaptors translate to JSON or SQL, but neutrality is not guaranteed. Point unearned. Sidebar below asks whether freedom is about interchange only, or query parity too.
  • Schema (1 pt). Attribute definitions — name, type, cardinality, uniqueness, documentation — enter the immutable log exactly like invoices. Full point earned.
  • Data (1 pt). All facts are append-only; a snapshot sees the world at one transaction boundary. Point earned.
  • Look-ups (1 pt). Entity IDs behave like graph edges; recursion feels native. Point earned.
  • Aggregations (1 pt). Built-in reducers (sum, count, user-defined) make roll-ups concise; materialising results is convention, not capability gap. Point earned.
  • Lambda calculated fields (2 pts). CMCC expects pure, side-effect-free expressions — totalPrice := qty × unitPrice—to live inside the ledger, version like data, and recompute on commit. Datomic relies on transaction functions in code; the provenance of the expression stays outside. Points unclaimed. Purity guardrail: The evaluator must run only referentially-transparent expressions—no HTTP calls, no wall-clock access—so the ledger stays deterministic.
  • Cradle-to-grave queryability (2 pts). Schema and data share one log; any past state can be reconstructed. Two points earned.
  • ACID envelope (1.75 pts) + native time-travel bonus (0.25 pt). One transactor serialises writes; peers read coherent snapshots; the as-of clause rewinds history—and if each transaction function’s byte-code hash is stamped into the log, you can replay logic as well as data. Full ACID plus bonus.

Add the primitive wins, cradle-to-grave points, ACID score, and bonus; subtract the syntax penalty: 7 / 10.

Sidebar — Why side-effects sabotage ACID

A single CMCC rule covers it: a derived value must be a pure function of the current snapshot. Side-effects break that promise in three ways.

  1. Non-determinism. A rates API might reply 1.097 now and 1.105 ten seconds later; peers reading the same snapshot see different truths.
  2. Hidden I/O. Calling an ERP system inside the transactor widens the transaction boundary beyond the ledger, forfeiting serialisable isolation.
  3. Audit blur. If the logic depends on the wall clock, you cannot replay yesterday’s state: the expression will notice “it’s not yesterday” and return a different answer.

The cure is simple: keep every expression referentially transparent and record its text or hash in the database.

What Datomic gets gloriously right

  • Schema as data. Migrations accumulate; nothing is destroyed. Queries answer why and when seamlessly.
  • Immutable facts. No lost-update races, no read skew.
  • Typed graph traversal. Recursive dependencies collapse into three-line queries.
  • Expressive aggregations. Built-ins plus custom reducers provide concise roll-ups.
  • ACID without drama. One transactor writes; peers fan-out reads.
  • Native time travel. as-of rewinds the entire world—including schema—and hash-stamped functions let you replay logic too.

These traits alone collect six points plus the time-travel bonus before deductions.

Where Datomic stops three points short

  • Syntax gravity. Until semantics travel across multiple notations and queries remain parity-equivalent, the syntax point stays off the board.
  • No first-class formulas. Transaction functions live in code; the ledger never sees the expression text. Two points remain unclaimed.

Purity checklist for compliant extensions

  1. Deterministic: same inputs, same outputs, forever.
  2. Side-effect-free: no network calls, file I/O, or wall-clock reads.
  3. Ledger-visible: store the expression text or an immutable hash inside the log.

Meet those three rules and any extension — however specialised — remains CMCC-safe.

Datomic in a CMCC workflow

One immutable rulebook sits at the centre: schema, facts, look-ups, aggregates, formulas, provenance. Downstream artefacts — Parquet files, search indices, caching layers — are mere projections. The ssot.me protocol serialises the rulebook into content-addressed commits; any engine fluent in the five primitives can pull or push semantics.

A minimal path:

  • Draft a commission scheme in Airtable.
  • ssot.me push exports attributes, look-ups, formulas, sample data, provenance.
  • Datomic ingests the bundle atomically.
  • A log-tail worker streams each transaction to Kafka; Omnigres hydrates analytic views.
  • Two weeks later the threshold changes; the cycle repeats. Datomic holds both rule versions indefinitely.

Analysts stay in a grid; developers use Datalog; auditors query any past state; downstream services consume shaped streams — without semantic drift.

Real-world patterns that prove the point

  • Regulated finance. Banks stream trades and rule hashes into Datomic, then replay yesterday’s book with tomorrow’s rules for surveillance.
  • Insurance policy engines. Eligibility logic encoded as Datalog rules flips via git commit; the transactor enforces instantly.
  • Retail analytics. Point-of-sale feeds append hourly sales; nightly jobs materialise summary facts; raw data persists for alt-roll-ups whenever curiosity strikes.

Each pattern treats Datomic as a semantic vault: immutable, deterministic, expressive, and replayable.

Runtime realities worth budgeting

Throughput, read latency, write amplification, and observability still matter, but they are operational concerns, not conceptual deficits. Plan buffers for bursty writes, warm peer caches, provision IOPS if you materialise aggregates, and monitor the 95th percentile latency.

How Datomic could climb toward eight

Persist formulas as data. Store expression text, dependencies, auto-recompute. +2 pts. Record rule provenance. Hash transaction functions, store the hash. +0.25 pt. Ship syntax-neutral APIs. Preserve semantics across JSON and SQL. +1 pt.

Two of those lifts Datomic into the high eights without touching the immutable heart.

Closing call-to-action

If you run Datomic today, start small:

  • Hash every transaction function on deploy and stamp the hash into the same transaction.
  • Store formula expressions as data, even if you still run them in code.
  • Keep every new function pure and side-effect-free — check it against the purity checklist before it hits prod.

Adopt those habits and you harvest most of the climb-to-eight benefits without waiting for vendor upgrades. Datomic already gives you history that cannot lie, queries that cannot race, and a model you can reason about in daylight. The remaining journey — syntax freedom and first-class formulas — is plumbing, not philosophy. Build the pipes, and the platform vaults higher; ignore them, and you still possess one of the most reliable semantic backbones available today, ready to power CMCC pipelines for as long as logic outlives syntax.

References & Further Reading

Join the ssotme://Protocol

The rulebook is not the code. It’s the source of truth. Versioned. Declarative. Collaborative. Like Git — but for business logic.

CMCC #Datomic #ImmutableData #TimeTravelingData #DeclarativeSemantics #RuleEngine #FivePrimitives #StructureOverSyntax #ComputableTruth


메타데이터
post_id
90a08d2a4e28
slug
datomic-time-traveling-data-immutable-semantics-90a08d2a4e28
url
https://medium.com/cmcc-deepdive/datomic-time-traveling-data-immutable-semantics-90a08d2a4e28
canonical_url
https://medium.com/cmcc-deepdive/datomic-time-traveling-data-immutable-semantics-90a08d2a4e28
author_url
https://medium.com/@eejai42
status
ok
fetched_at
2026-08-25 02:51:28