Developing Event-driven Thinking for Software Architects and Programmers

Start asking these questions before publishing a message to a service bus.

Sasha Marfut
Geek Culture

--

Photo by Sincerely Media on Unsplash

In this article, we are going to look at few important considerations for architects and developers who are designing and implementing event-driven microservices systems. Each consideration can either simplify your design, make the architecture more extensible and help you avoid unpleasant bugs.

Should my Message be a Command or an Event?

Every message that you publish to a service bus queue can be either command or event. From the service bus point of view there is no difference between the two, because commands and events are just piece of the data that the service bus transfers from publisher to the consumer.

However, in terms of design, the commands and events are fundamentally different. Let’s summarize the key differences between the two.

Commands vs Events

  1. The command represents the intention to invoke some behaviour. For example, one microservice can send a SendEmail command to a Notification microservice, which, in turn, can execute or reject the command if it is invalid (some data is not provided in the command model).

--

--

Sasha Marfut
Geek Culture

1 million+ views on Medium | .NET, Design Patterns, Architecture, API