Definition of a microservice

There is no single universally accepted definition of microservices. Wikipedia defines microservices as follows:

Microservices are a more concrete and modern interpretation of service-oriented architectures (SOA) used to build distributed software systems. Like in SOA, services in a microservice architecture (MSA) are processes that communicate with each other over the network in order to fulfill a goal.

There is no clear description on how to define microservice. Many people have expressed their different views in this area. Most of them conclude them into characteristics. The main characteristics are single responsibility, loose coupling, high cohesion, serving business purpose, lightweight communication, and few LOC (10-100). Although the LOC rule cannot be justified, as every language has a different syntax or library; so LOC can vary in that.

Amazon made a term famous: two-pizza team. As per this term, a microservice can be so big that it can be handled by a team which can be fed two pizzas. So, at max, 12 people can be in the team. It includes tester and developer, and if you are in agile, it should include a product owner. While defining a microservice, keep in mind that the attributes which change together should stay together. Another definition of microservice can be defined as a software application whose independently deployable, small, modular services communicate through a well-defined, lightweight mechanism to serve a business goal.

How small or big should it be, is the question for the industry. More and more people coming into the industry with different flavor of microservice implementations may give some direction to microservice design patterns. For now, I would like to spot it as an independent deployable module with an isolation failure plan serving a single business goal, which can be stated in simple short lines without using any conjunctions.

In the upcoming section, we will discuss two important aspects: Service Discovery and API Gateway. These two aspects play an important role while defining a microservice.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset