Comment by krackers
1 year ago
Double-entry: each row of your DB stores {debit account, credit account, amount}.
Single-entry: each row of your DB stores {account, delta}.
With double-entry you are guaranteed via your schema that sum(debit delta) = sum(credit delta), that's it. Money is "conserved".
It's easy to denormalize the double-entry into a single-entry view.
That kleppman article talking about movements as edges of a DAG is the only place this is ever talked about clearly.
No comments yet
Contribute on Hacker News ↗