5 ms·
The section on "Minimize state in-flight" [1] has an example of an event with both an amount withdrawn and the new balance, and the author recommends sending on
by xtagon 8y ago
The section on "Minimize state in-flight" [1] has an example of an event with both an amount withdrawn and the new balance, and the author recommends sending only the amount instead.
Wouldn't it be useful to send both, since if the expected balance does not match up when the event gets processed, that must mean something was processed out of order?
[1]: https://rjzaworski.com/2019/03/7-commandments-for-event-driven-architecture#7-minimize-state-in-flight https://rjzaworski.com/2019/03/7-commandments-for-event-driv...
- aarbor989 8y agoWell when you work with distributed messaging systems it can be difficult (if not impossible) to guarantee messages arrive or are processed in the same order in which they were generated. So I think the author is just saying generally speaking it’s better to track as little state as possible if you don’t need to.
- pyrale 8y agoI don't think it is a good idea to mix payload data and consistency mechanisms. Better keep the two split. For instance, if you want to ensure that your system is consstent, you can identify your events in such a way that you can infer the previous in sequence (e.g. if you received event 1 and 3, you know that you've lost event 2). This way you keep two separate, simple mechanisms to deal with two problems, rather than getting one more intricated problem.