Fintech Lab
Lesson 41Scale and concurrencyAdvanced
Partitioning and historical snapshots
Bound the hot working set. Snapshot at period close. Archive the rest.

Ten years of entries. Billions of rows. Even with cached wallet balances, queries that need history (statements, audits, fraud investigations) hit cold storage and crawl. The architectural fix is two-layered: (1) PARTITION journal_entry by month (or quarter) so most queries scan only recent partitions, and (2) SNAPSHOT balances at every period close (Lesson 15) so any historical balance query becomes 'find the snapshot + apply deltas since.' The ledger NEVER grows unboundedly hot, each closed period becomes a fixed-cost lookup. This lesson uses three entries to simulate activity across periods; the teaching is in the architecture.

Fintech Lab is a free, interactive lab for fintech engineers. Real ledger, your own sandbox, engineering patterns from production. See all 85 lessons.

Search lessons

Type to find any of the 85 lessons. Press Enter to open.