Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Your database has one clock. Every audit question needs two.

说明与用途

单时钟数据库无法恢复过去的系统信念,导致发票争议。使用 Minigraf 的双时钟存储,可以查询系统在计费时的信念并解决争议。

问题

A customer disputes an invoice because the system’s belief about a plan at the time of billing differs from the current state, but the database only stores a single clock, making it impossible to reconstruct past beliefs.

结果

The dispute is resolved in two queries: the system believed Starter at billing time, so the invoice was correct then, but it now believes Pro, making the invoice incorrect and requiring a credit. No audit table was needed.

工作流

  • 1. Install Minigraf v2.0.3 prebuilt binary and verify SHA‑256.
  • 2. Create a graph file and transact the initial fact: Acme’s plan is Starter from 2026‑01‑01.
  • 3. Record the billing moment (BILLED) and wait 2 s.
  • 4. Retract the Starter fact, then transact a new Starter fact with a valid‑to of 2026‑02‑20, and finally transact Pro from 2026‑02‑20.
  • 5. Query the graph twice: (a) as‑of the billing timestamp and valid‑at March 1 to get the believed plan (Starter); (b) valid‑at March 1 to get the current plan (Pro).

证据

Support opens the customers table. It says Pro. The updated_at column says March 15. The row that existed on March 1, the one the billing job actually read, is gone.

来源

A bi‑temporal database keeps both, for every fact, and never overwrites either.

来源

(query [:find ?plan :as-of "2026-10-06T05:49:36Z" :valid-at "2026-03-01" :where [:acme :plan ?plan]]) :starter

来源

(query [:find ?plan :valid-at "2026-03-01" :where [:acme :plan ?plan]]) :pro

来源

  • 记录日期: 2026-10-09T18:40:52.452Z