ledger ને account અને time વડે partition કરો, તાજેતરના data ને hot અને જૂના data ને cold રાખો, અને rows ને append-only immutable ledger તરીકે ગણો — જેથી એક account ની history એ નાની, indexed slice હોય, ક્યારેય અબજો rows નું scan નહીં. access pattern હંમેશા "એક account, એક date range" છે, તેથી તેને match કરવા partition કરો.
આર્કિટેક્ચર
Write ─▶ Ledger table (append-only, immutable)
partition by (account_hash, month)
│
┌────────┴─────────┐
HOT tier COLD tier
last 3 mo older
Postgres/SSD S3/Parquet, Glacier
│ │
index-seek keyset paginate ──▶ API (account+range)
