3 ms·
Can you recommended a good article that goes over the ledger pattern (the easy part) and the performant calculation of balances as the ledger grows? I'm going t
by karamanolev 3y ago
Can you recommended a good article that goes over the ledger pattern (the easy part) and the performant calculation of balances as the ledger grows? I'm going to start working on a warehouse management system in the coming months and that would come in handy.
- SoftTalker 3y agoI don't have a link but when I've implemented systems with a "ledger" of changes I would have a field that indicated whether the ledger item had been "posted" to the the affected account(s) and therefore the balance was just the account balance +/- any unposted ledger items. I've had ledgers that were posted once a day, or more often, up to nearly real-time. But once a ledger item is posted, it should never be changed. If an error is discovered, make a new ledger entry to correct it.
- moring 3y agoThe pattern in general is called "event sourcing", but unfortunately it's popular enough to make a lot of bad articles appear, and I can't recommend a good one.
- williamcotton 3y agoThe ledger pattern is called double-entry accounting. Make sure your product managers understood that you’re being tasked with creating an accounting system. They probably haven’t really thought it through very well.
- hmeh 3y agoRelevant, not all logs are ledgers. https://twitter.com/sbellware/status/1742653635387941099 https://twitter.com/sbellware/status/1742653635387941099