What is a ledger database?

Ledger database

A ledger database is the store that holds balances and the transactions that change them. It is built for append-only posts, unique references, and balance invariants. Your application database holds customers and sessions. If you post money in the app database, you have two books, and they will drift.

How does a ledger database work?

It stores each movement as a row you do not edit. It keeps a running balance or can rebuild one. It rejects a second post with the same reference. It applies a debit and a credit together. Those are ledger jobs. User tables are not designed for them.

Ledger database vs application database

The app database answers “who is this user.” The ledger database answers “what do we owe them.” Joining them in one Postgres is fine. Using the users table as the wallet is not. When a refund races a payout, the users table will lose.

Can you build one yourself?

Yes, and teams do, until retries, inflight holds, and recon appear. The cost is not the schema. It is every failure mode you have not seen yet. Buy or adopt a ledger when more than one party can hold a balance.

Blnk Core is that store. You keep customers and logins in your app. You post money in Blnk. See ledgers.