Stories · Season 3 — Magpie · Episode 10

What Did My Balance Say Last Tuesday?

In which a customer, a regulator, and a lawyer all ask Magpie the same question about the past — and for once, Magpie just answers.

The story

It came in three flavors over one memorable month.

A customer, disputing a charge: “On the 9th, before that payment, my balance was definitely higher than you’re claiming. What did my account actually look like that morning?”

A regulator, conducting a routine review: “Show us the exact state of these fifty accounts at midnight on the last day of the quarter. Not a report generated now — the actual position as of then.”

And a lawyer, regarding a frozen account: “We need the account’s precise standing on the date of the court order, reconstructed, with the events that led to it.”

Three years earlier, any one of these would have ruined Kemi’s week — a scramble through backups, log files, and “well, we think…” estimates, ending in an answer nobody could fully stand behind. But Magpie had grown up over the course of this season. Every change to every account was an immutable event. The current balance wasn’t a number someone overwrote; it was the sum of everything that had ever happened, kept in order, forever.

Which meant “what did this account look like last Tuesday?” wasn’t a forensic project. It was a question the system could simply answer — by replaying the account’s events up to last Tuesday and stopping there.

Why this is hard the traditional way

Most systems can tell you what’s true now and almost nothing about what was true then. Because they store current state and overwrite it, the past is gone the moment it changes. Reconstructing a historical position means restoring a backup from that date (slow, coarse, and often unavailable at the granularity you need), or stitching together log fragments and hoping the story is complete.

So “as of” questions — the bread and butter of finance, healthcare, insurance, and anything regulated — turn into expensive archaeology with a shaky conclusion. “We believe the balance was…” is not an answer you want to give a regulator, a court, or a customer who kept their own records.

How Relay changes the ending

Because Relay stores the full event history, it can reconstruct an aggregate’s state as of any past moment — time-travel — and compute derived values directly from the stream. You don’t need a backup or a time machine; you replay the events up to a chosen point and read the state that existed then.

// The account exactly as it stood at midnight, last Tuesday — reconstructed from events.
var asOfLastTuesday = await repository.LoadAsOfAsync(accountId, lastTuesdayMidnight);
Console.WriteLine(asOfLastTuesday.Balance);   // the real historical figure, not an estimate

So the customer gets the actual balance that morning, with the events that explain it. The regulator gets the genuine quarter-end position of all fifty accounts, as of then, not a report fudged from today. The lawyer gets a defensible reconstruction with its full lineage. Three questions that used to mean three bad weeks now mean three queries.


Over three seasons, three very different companies kept arriving at the same quiet realization. Pemberton & Crumb learned they couldn’t explain their own numbers. Frontrow learned they couldn’t say who did what in their own system. Magpie learned that “what was true, and when?” is the question a serious business has to be able to answer on demand. The thread tying all thirty stories together isn’t really CQRS, or sagas, or projections. It’s this: software you can trust is software that can account for itself — its rules, its history, and its truth — without a scramble, an estimate, or a shrug.

What it costs you to ignore this

  • The past becomes unanswerable. Overwriting state means “what was true then?” has no reliable answer when it matters most.
  • “As of” questions turn into archaeology. Backups and log-stitching are slow, coarse, and end in “we believe,” not “we know.”
  • Disputes and audits get expensive. Every historical question becomes a bespoke investigation instead of a query.
  • Trust is the final cost. Customers, regulators, and courts remember whether you could prove your own past — or only guess at it.