← Back to context

Comment by rawgabbit

6 hours ago

The old timey systems modeled this problem using accounting 101.

When things change, you don’t immediately update the balance. Instead it is written to a transaction journal aka a log. The thing is this log is the source of truth. State or the balance is derived from the log.

You don’t send a continuous stream of logs. Instead it is batched and sent asynchronously. It is also applied asynchronously. It also records if the batch was successful or not.

If you have multiple systems sending their logs to a central server. No problem. The central server orders them all before applying the batches.

Every so often. The books are “closed”. Meaning the central server won’t accept any more journal entries for things that happened older than X dates.

I dunno about "old timey", I wrote a system that does exactly this like six months ago. Granted, it's a money tracking system.

It's always surprising to me how much of the real world runs on CSV and EDI files sent back and forth over SFTP.