Ledger Lane
Every cent is accounted for. Even if the server crashes in the middle of the rush.
How a payment flows
Customer
€50.00
Server
AcceptedOwn number
Bank account+€50.00
Brand receives−€42.50
Platform fee−€7.50
Difference
Every cent accounted for
The proof
100,000payments in parallel, the total still matches to the cent
410/sentries per second, measured on a laptop
10,054duplicate requests caught, none booked twice
0€lost, even though the server was killed hard midway
The problem
A marketplace collects money for many brands. Money must never be booked twice, halfway or lost.
- Customer clicks Pay twice
- Server crashes in the middle of a booking
- Bank and accounting show different numbers
Try it yourself
Go ahead and click twice. Crash the server. Every cent is still booked exactly once.
Try it: follow the golden hints.
Accounts
Bank account€0.00
Brands, payout pending€0.00
Platform fee, 15 %€0.00
Difference, must be 0€0.00
What happens
0Payments booked
0Double clicks caught
0Crashes without damage
€0.00lost
Rebuilt in the browser with the same rules as the real booking system: every payment has its own number and is booked only once, a crash books nothing halfway, the difference stays 0. The real code is on GitHub.
Bank reconciliation
Bank statement in, discrepancies out. Paid out money is closed automatically.
Figures from the demo run with the real bank statement in the repo, the example rows are simplified.
How every cent stays clean
- Double entry bookkeeping: every booking balances, the difference is always 0
- Own number per payment: sent twice, still booked only once
- Immutable: errors are reversed, never deleted
- Message to other systems (Kafka): every booking is guaranteed to arrive
- Key based access: shop books, finance pays out, audit reads
- Euro and dollar: each currency balances to 0 on its own
- Java 21
- Spring Boot 4
- PostgreSQL
- Kafka
- Flyway
- Spring Security
- Testcontainers
- OpenAPI
- Docker
- GitHub Actions
- Trivy