Posts

Showing posts with the label event-driven

Four Event Driven Patterns

Image
In this story I would like to explain my understanding of the Event Driven Architecture(EDA) and its patterns. I was assigned to introduce the CQRS pattern in my previous company. That is how I got to know about EDA. EDA comes with a lot of concepts like  Events, Commands, Event sourcing, Aggreate, Evet Reaplay  etc.. . I’ll briefly explain what EDA is and what common patterns are. Event Driven Architecture(EDA) EDA is producing, captureing , processing and persisting of Events . The concept of the EDA is not new. When we talk about EDA, we can identify two types of objects, those are  Event  and  Command.  We cannot do a proper implementation without knowing these two. Command Command is a request to a system to do something and sometimes expects a response for that. Command is very specific and it has a known destination. That means we know what is going to process and who is going to execute our command. Let’s take an Ordering...

Failed CQRS implement in Microservice architecture.

Image
CQRS is a useful pattern when having a complex business application where reading and writing have separate requirements. For an example, Write wants to maintain a model in normalised form in a RDB but Read can represent model as document in a Document database. But it is not easy to get head around about CQRS. It comes with  Reads, Writes, Events, Commands, DDD, Event Sourcing, Eventual Consistency . The common way of implementing CQRS is by creating two services communicating with Events. Our CQRS Implementation In order to bring CQRS into our custom framework we used  Axon framework.  At time when we evaluated CQRS frameworks, Axon was the easiest way to work with and had good support for  Spring Boot  framework. This is how Axon was used. CQRS implementation We ended up creating two separate services for Writes and Reads. These two services connected via RabbitMQ. Write Service Write service handles all the Updates. We did not try to ...