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.
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.