Member-only story
Messages Are Not Events
Ever since the micro-services movement began, many organisations ventured into adopting it without making sure everyone involved in the process has the same understanding about the clear distinction between a message and an event, as a result they end up building a distributed monolith.
I am not going to cover all the good design principles of an ideal micro-service based architecture, but want to shed some light specifically on the key difference between a message and an event and the consequence of each on your architecture.
If you are keen to learn more about the event based design principles, I highly recommend the book Domain Driven Design by Eric Evans, if you further want to explore the philosophy of good architecture then I would suggest you read the classic - Timeless way of Building by Christopher Alexander.
Message vs Event
A message is a catch-all term used to identify any data/payload sent from one service to another service over a communication medium like Kafka/RabbitMQ etc.
In most circumstances, messages are actually “Commands”. if you are familiar with the CQRS terminology, then a message represents the same concept as a command in cqrs.
Let’s explore the difference between message & event by taking an example use-case of payments, which could be…