Iโve seen a lot of people from the comment session ask:
โWonโt deriving balances from a long ledger history cause massive latency?โ
Yes, if youโre recalculating millions of ledger entries every time a user opens their app.
So hereโs what most banks and mature fintechs actually do:
The ledger still remains the source of truth,
A balance snapshot is maintained for fast reads,
Every transaction updates both the ledger and the balance atomically within the same database transaction.
When you check your account balance, youโre usually reading the snapshot, not replaying years of transaction history.
The ledger is for accuracy and auditing.
The balance is for speed.
If anything ever looks off, the balance can be recomputed from the ledger.
Trust that is very clear now ?
You sef stay one place ๐
If you're not using a balance column, I don't know what you're doing
Cus how do you calculate users balance on the fly from the ledger every single time they open your app
Quoting my earlier tweet:
โIf youโre building a wallet system and your source of truth is a balance column,
May the database gods be with you ๐โ
Letโs talk about why this is dangerous and exactly how to design the tables properly.
A new month. A new page. A new opportunity to become more than you were yesterday.
This June, don't just count the days, make the days count, take one step closer to the future you're building.
Happy June, GIDAns. Letโs go be great!
@prime_sui Nestjs is an opinionated framework and as such has several conventions.
It uses decorators to define how your classes and methods behave.
It also makes your code look cleaner and organised.
So why wouldn't anyone love Nestjs? ๐