- Lightning talk, ~20 min. One thesis, three patterns. Move fast. - Open cold: say the title, let it breathe. - Then quick hello. Next two slides: who I am, why this talk. - Then the one claim that runs through everything. ≈0:00
- Quick hello. API + data standards at Geonovum (Dutch public sector). - My world: public registers. Systems of record for property, people, money. - Perfect lens: used by everyone, and getting history wrong is expensive (sometimes in court). - So: I think about temporal data for a living. ≈0:20
- Why this talk: registers run on ebMS + StUF, decades-old SOAP/XML. - The twist: those old standards are GOOD at exactly this: bitemporal history, corrections, exactly-once. - But end-of-life; the modern baseline is REST. - Danger: treat REST as a clean slate, throw the rigor away. (REST defaults to "now".) - So: working group on history. Keep the rigor, drop the legacy. - SAY CLEAN: "almost every API knows only one word, and that word is 'now'." ≈0:45
- The thesis. Say it, let it land. Then click on. - CRUD = an eternal present. GET = current state; PUT overwrites yesterday with today. - The world is not one state: it has history, validity, and a separate question: when did we know that? Hold it; it is the whole talk. ≈1:20
- You have felt this lie, even if you never named it. - git blame: any line of code = what, who, when, why. - Try that on a DB row: no blame. Column holds today; the past is gone. - SAY CLEAN: "our code remembers everything; our data remembers nothing." - Same pain, other faces: report will not reproduce, audit cannot explain a past decision. - The plan: make your data behave like git. ≈2:00
- The fix: every fact lives on two timelines, not one. - Weather forecast: valid time = day it is about (Sat); transaction time = when recorded (Mon). - Re-forecast Wed: same Sat, new record. Same valid time, new transaction time. Independent. - They come apart often: backdated fix (record last year today); future-dated change (price starts next month). - Value dates, effective dates, created-at: all the same two timelines. - Two is enough. A third exists (decision time), but start here. ≈3:30
- Two timelines on two axes = a plane. - Side = valid time (upcoming days forecast). Bottom = transaction time (day each forecast recorded). - Each box = a belief: the forecast for that day as held at that moment. - Every box is a future day, so each row = same day, re-forecast. - Sat row: 16 Mon, 18 Tue, 24 Wed. Forecast for Sat changing each day. - A query = one point (which day, as known when). Lands in exactly one box. - Notice "now": just the rightmost column. One coordinate among many. ≈5:00
- Two coordinates, so read and write are two different jobs. - Write = not "set value to X". It is "as of now, I assert X". You append. - Read = not "give me the value". It is "give me the view at a moment". You project. - Plain CRUD collapses both into one GET/PUT resource. Only works if you pretend one current state: the lie. - Roadmap: Pattern 1 = write side, Pattern 2 = read side, Pattern 3 = writes safe over the network. ≈6:30
- Pattern 1, the write side. - Overwrite = past gone for good, never reproducible. So stop. - A write = new immutable version. Old versions keep their URLs. - "Delete" = a fact too: "closed as of T". A tombstone, not an erasure. - Sounds heavy? You already trust git: it never rewrites, it appends and points. - We just bring that discipline to your data. ≈8:00
- Same idea on the wire. - PUT replaces and loses history: drop it. POST appends instead. - Each valuation = stable id + own URL. Old ones fetchable forever. - Bonus: optimistic concurrency, free. Version id doubles as ETag. - If-Match: "v7". If someone wrote v8 already, server returns 412 instead of clobbering. - Safe concurrent writes, no locks. ≈9:30
- The question everyone asks: how do you fix a mistake? - Do not edit. Append a correction that supersedes the old version, by id. - Why by id, not date? The date can be the mistake (v7 had the wrong validFrom). Id is the only stable handle. - v7 never deleted: stays, marked superseded by v9. Like a git commit naming its parent. - Trail shows: what you believed (v7), the correction (v9), when each happened. - Pair with If-Match: "v7". 412 if someone already superseded it. - SAY CLEAN: "you can fix the past without erasing it." ≈10:15
- Pattern 2, the read side. The feature people fall in love with. - Make the moment you read from an explicit input, not always "now". - Pin the coordinates: the answer never changes. Not next week, not in five years. - The repeatable question. Gold for audit, debugging ("what did it return last Tuesday"), reproducible reports, ML training sets. - Frame: the Wayback Machine, for your own data. ≈11:00
- On the wire: just two query params. - validAt = point on valid timeline. recordedAt = point on transaction timeline. - Set one: slide along an axis. Set both (line 3): one named point = the dot on the plane. - Leave both off: default to "now". Behaves like the boring API everyone expects. - "now" is the default coordinate, not the only one. - Bonus: a past snapshot is immutable, so infinitely cacheable. Mark it immutable, a CDN holds it forever. - Temporal design and caching are friends. ≈12:30
- Pattern 3. Time in the data is done; now time in the protocol. - Between "request sent" and "response received": a gap. You do not know the outcome. - POST a payment, connection times out: did it land? No idea. - Retry blindly: maybe a double charge. - A timeout is not failure. It is unknown. - If writes are not safe to retry, every flaky connection adds duplicates to your append-only log. ≈14:00
- The fix: an idempotency key. - Client mints one unique key per intended operation. - Server stores the result against the key, replays it on any retry. - Same key, same payload, same payment. No double charge. (The Stripe pattern.) - SAY CLEAN: "exactly-once delivery is impossible; exactly-once effect is not." - That effect is what everyone actually wanted. ≈15:30
- Rapid fire, the things that bite. - Server owns transaction time. Client clocks lie and skew: never trust them. - UTC on the wire. Localize only at the edge. - Corrections ripple: a backdated fix makes cached answers wrong. Webhooks must announce "this past value changed". - GDPR vs append-only: withdraw the record logically, keep the bytes for audit. - Crypto-shred (encrypt per subject, destroy the key) only when you must truly erase. ≈17:00
- Pull the thread together. - One thing: stop letting "now" be the only moment your API can talk about. - Append, not overwrite. Read at a chosen moment (validAt, recordedAt). Make every write safe to retry. - Then reproducibility, audit, safe retries stop being bolt-ons. You get them for free. - SAY CLEAN: "time is an axis; put it in the contract." ≈18:30
Q&A buffer. Likely questions to have answers ready for: - "Isn't this just event sourcing?" → it's the storage substrate; the talk is about exposing it in the contract. You can do bitemporal on a plain RDBMS with SQL:2011 temporal tables. - "Performance of as-of reads?" → immutable snapshots cache forever; index on both time axes; most reads are still 'now'. - "Do I need this everywhere?" → no. Reach for it where reproducibility or audit matters: money, health, legal, valuation. - Vocabulary for defense: valid time, transaction time, bitemporal, as-of, effective dating, optimistic concurrency, idempotency key. ≈20:00