anitsh / til

Today I Learn (til) - Github `Issues` used as daily learning management system for taking notes and storing resource links.
https://anitshrestha.com.np
MIT License
78 stars 11 forks source link

Microservices #124

Open anitsh opened 4 years ago

anitsh commented 4 years ago

image image

According to Sam Newman, author of book "Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith", developers should contemplate these three questions before adopting a Microservice architecture:

  1. What are you hoping to achieve?
  2. Have you considered alternatives to using Microservices?
  3. How will you know if the transition is working?

Microservice Architecture Challenges:

As engineering groups adopt microservices architectures, individual teams may start to fragment in their technical decisions. This can lead to a variety of challenges:

image

As microservices become increasingly popular, they are more likely to be used in situations where the costs far outweigh the benefits.

Microservices are a tool in a toolbox, and they work best when reflected in the organizational reality.

Reference

anitsh commented 3 years ago

Principles

Interface Segregation, Deployability (is on you), Event-driven, Availability Over Consistency, Loose-coupling, and Single Responsibility.

Interface segregation tells us that different types of clients (e.g., mobile apps, web apps, CLI programs) should be able to interact with services through the contract that best suits their needs.

Deployability (is on you) acknowledges that in the microservice era, which is also the DevOps era, there are critical design decisions and technology choices developers need to make regarding packaging, deploying and running microservices.

Event-driven suggests that whenever possible we should model our services to be activated by an asynchronous message or event instead of a synchronous call. Availability over consistency reminds us that more often end users value the availability of the system over strong data consistency, and they’re okay with eventual consistency.

Loose-coupling remains an important design concern in the case of microservices, with respect to afferent (incoming) and efferent (outgoing) coupling.

Single responsibility is the idea that enables modeling microservices that are not too large or too slim because they contain the right amount of cohesive functionality.