Posts

Showing posts with the label microservices

Why Microservices fail??

Image
Microservices is a buzz word in the tech community for a few years. Some have used it, others want to use it, and some of them are struggling with it. What is the Microservice Architecture? In simple terms, Microservice architecture is an approach to develop a single application as a set of small independent services; they communicate with each using a lightweight mechanism. Most of the time, this lightweight mechanism is HTTP resource API. What are these independent services? They are  Autonomous  services modelled around a  Business Domain . Autonomous These microservices can evolve, change and deploy independently each other. That means we can add new classes, remove and change classes, change the schema of each service without affecting others. These services are loosely coupled. Business Domain Each microservice has its specific domain. For example, if we take Customer Service, it should be able to do all customer-related operations. But this i...

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 ...