24 ms·
Maybe I'm not understanding it, but don't you keep a record of the current balance all the time? And only need to go through the transactions in order to verif
by rwmj 1y ago
Maybe I'm not understanding it, but don't you keep a record of the current balance all the time? And only need to go through the transactions in order to verify the ledger invariants, which I guess would only happen fairly rarely?
- jgalt212 1y agoI guess, but often, or often enough, you don't just need the balance now, but also then.
- accrual 1y agoMakes sense. It seems like one would need a wrapper like "getBalance(accountName, dateTime)" which would abstract iterating over the ledger to find the balance at a certain time. But I could see this being a performance hotspot - looping over rows and tallying a running sum across many accounts seems like a waste of cycles. What's the alternative to the "what was the balance at date/time" in non-ledger based systems?
- em-bee 1y agoshouldn't the balance be calculated and and compared with the actual balance after every transaction? i have an account where money went missing. the only way to find out when that happened was to have a record of the actual balance after every transaction.
- _boffin_ 1y agoProblem is solved with 4 timestamps.