← Lessons

quiz vs the machine

Silver1110

System Design

The Immutable Ledger Design

Append only records that are never edited or deleted, only corrected by new entries.

4 min read · intro · beat Silver to climb

Append only by design

An immutable ledger never updates or deletes a posting once written. Corrections are made by appending a new reversing entry rather than editing history. This preserves a complete and tamper evident record of what happened.

Why immutability helps

  • You get a full audit trail for free because nothing is overwritten.
  • Concurrent readers never see a half edited row, which simplifies caching.
  • Disputes can be resolved by replaying the exact sequence of events.

Correcting mistakes

If a posting was wrong, you write a reversal that cancels it, then post the correct entry. The original stays visible so auditors can see both the error and the fix.

Storage notes

  • Use a monotonically increasing sequence number per entry.
  • Optionally chain each entry with a hash of the previous one for tamper evidence.
  • Snapshot balances periodically so reads do not scan all of history.

Key idea

A ledger is append only, so you fix mistakes by adding reversing entries, never by editing the past.

Check yourself

Answer to earn rating on the learn ladder.

1. How do you correct a wrong posting in an immutable ledger?

2. What is one benefit of an append only ledger?