I built Parity Ledger to solve a problem most backend systems ignore. Most systems track money with a single balance column, a number sits on an account record, it goes up when money comes in, it goes down when money goes out. That works fine until two requests hit the same account at the same time, or until someone needs to know what actually happened to an account months later and there is nothing but today's number staring back.
Parity Ledger is a double entry bookkeeping engine built with NestJS and Postgres. Instead of storing a balance, every movement of money is written as a permanent, immutable entry. Nothing gets updated, nothing gets deleted. Every transaction writes two entries at once, a debit and a credit, inside a single atomic database transaction, so money can never leave one account without landing in another.
To keep things correct under real concurrent pressure, the ledger uses row level locking at the exact point where two requests could touch the same account balance at once. I built a live dashboard to actually demonstrate this, firing two transfer requests at the same account at the same moment and watching the lock force one to wait its turn.
In the video I walk through how it all works, the reasoning behind ditching the balance column, how the debit/credit pairing is enforced, and a live demo of the concurrency lock in action.
Top comments (0)