ledger ਨੂੰ account ਅਤੇ time ਨਾਲ partition ਕਰੋ, ਹਾਲੀਆ data ਨੂੰ hot ਅਤੇ ਪੁਰਾਣੇ ਨੂੰ cold ਰੱਖੋ, ਅਤੇ rows ਨੂੰ ਇੱਕ append-only immutable ledger ਵਜੋਂ ਸਮਝੋ — ਤਾਂ ਜੋ ਇੱਕ single 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)
