Microservices

 Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of services that are:

  • Independently deployable
  • Loosely coupled

Services are typically organized around business capabilities. Each service is often owned by a single, small team. 

Developers can build these services in several programming languages, deploy, scale, and maintain them independently, and enable communication between them via well-defined APIs. Larger applications can remain mostly unaffected by the failure of a single module.
Communication between services is complex, more services equals more resources, debugging problems can be harder, deployment challengers, microservices are great for large companies, but can be slower to implement and too complicated for small companies who need to create and iterate quickly, and don’t want to get bogged down in complex orchestration.
Micro service Architectural Patterns
Saga architecture pattern: It provides transaction management using a sequence of local transactions.A local transaction is the unit of work performed by a Saga participant. Every operation that is part of the Saga can be rolled back by a compensating transaction. Further, the Saga pattern guarantees that either all operations complete successfully or the corresponding compensation transactions are run to undo the work previously completed.
CQRS pattern: CQRS is one of the important pattern when querying between microservices. We can use CQRS design pattern in order to avoid complex queries to get rid of inefficient joins. CQRS stands for Command and Query Responsibility Segregation. Basically this pattern separates read and update operations for a database. By this isolation, we can even use different database for reading and writing database types like using no-sql document database for reading and using relational database for crud operations.
Circuit Breaker pattern to gracefully degrade functionality when a method call fails. Use of the Circuit Breaker pattern can allow a microservice to continue operating when a related service fails, preventing the failure from cascading and giving the failing service time to recover.





Comments

Popular posts from this blog

Transform values with a stream

Collections Framework

Inspect a collection