ledger کو account اور time سے partition کریں، حالیہ ڈیٹا hot اور پرانا ڈیٹا cold رکھیں، اور rows کو ایک append-only immutable ledger کے طور پر لیں — تاکہ ایک واحد account کی history ایک چھوٹا، indexed slice ہو، کبھی اربوں rows کا scan نہیں۔ access pattern ہمیشہ "ایک account، ایک date range" ہے، لہٰذا اس سے میل کھانے کے لیے 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)
