"Turning the database inside out with Apache Samza" by Martin Kleppmann
(Command and Query Responsibility Segregation)
We use this pattern in heaps of places with a payroll product.
Was the edit to payslip 9 correct or incorrect?
Now we can see the logic behind the changes
Set to true when the shift has been processed
We start processing the job
Fetch the shift details from the db
Edit is made
Processed flag is marked as true and the edit is not processed
We could process each change sequentially but that might be unnecessary
Grab the latest version which is unprocessed and process the latest version
Repeat when more changes come in
James Harvey
Chief Software Architect @ foundU
By James Harvey