1 August 2026   4 min read

Immutable ledgers, or why I stopped allowing edits

A corrected accounting entry made a report I had already sent out wrong. The fix was to stop allowing corrections.

CompanyDiary started with an edit button on every ledger entry, because that is what a normal CRUD application has. Then a partner corrected an entry from two months earlier, and a report that had already been printed and agreed stopped matching the system.

Accounting solved this problem centuries ago and I had ignored the answer. You do not edit an entry. You write a new, reversing entry, and then the correct one. The history stays true, the mistake stays visible, and any report generated at any point in time remains reproducible.

The second decision that followed from it: do not store the balance. Compute it from the entries. A stored total is a second source of truth, and two sources of truth eventually disagree.

The third: store money as integer minor units. Floating point cents add up to a number that is very slightly wrong, and in a ledger very slightly wrong is wrong.

All notes