Commands vs Events
Communication over a message bus is often done with Commands and Events. But, what's the difference between them? Aren't they both just messages?
Software Engineer
Events are notifications of things that have happened. They are fundamental in event-driven systems where services communicate by publishing events when their state changes.
Communication over a message bus is often done with Commands and Events. But, what's the difference between them? Aren't they both just messages?
The Transactional Outbox Pattern ensures a message is always published to a message broker when making changes to a database, even if the message broker fails initially. This is essential for event-driven architecture to ensure consistency when other services are rebuilding state from your events.
We explain the pros and cons of Event Sourcing compared to traditionally updating the current state in a database. We cover trade-offs with Eventual Consistency, problems with concurrency, and options to solve those with optimistic concurrency techniques.
There are different kinds of events found in event-driven systems. They often represent the same thing that has happened, but serve different purposes and have different advantages. Here I'd like to outline the differences between a few terms.