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)
