What are microservices?

What are microservices? This is the question the enterprise world is asking the computing world. Because of the bigger teams, the companies are ready to embrace microservices for breaking down tasks. Microservice architecture replaces the traditional monolith with granular services that talk to each other with some kind of agreement.

Microservices bring the following benefits to the plate:

  • If the team is big, people can work on chunks of applications
  • Adaptability is easy for the new developers
  • Adopting best practices, such as Continuous Integration (CI) and Continuous Delivery (CD)
  • Easily replaceable software with loosely coupled architecture

In a monolith application (traditional application), a single huge server serves the incoming requests by multiplexing the computing power. It is good because we have everything, such as an application server, database, and other things, in a single place. It also has disadvantages. When a piece of software breaks, everything breaks. Also, developers need to set up an entire application to develop a small piece.

The disadvantage list of a monolithic application could be:

  • Tightly coupled architecture
  • Single point of failure
  • Velocity of adding new features and components
  • Fragmentation of work is limited to teams
  • Continuous deployment is very tough because an entire application needs to be pushed

Looking at the monolith application, the entire stack is treated as a single entity. If the database fails, the app fails. If a bug in the code crashes the software application, the entire connectivity with clients goes down. This actually led to the emergence of microservices.

Let us take a scenario. A company run by Bob uses the traditional Service Oriented Architecture (SOA), where developers work around the clock to add new features. If there is a release, people need to test the code overall for every small component. The project moves from development to testing when all changes are done. Another company on the next street, run by Alice, uses the microservices architecture. All software developers in Alice's company work on individual services, that get tested by a continuous build pipeline that notifies things pretty quickly. The developers talk with each other's REST/RPC APIs to add new features. They can easily shift their stack from one technology to another, as compared to Bob's developers. This example shows that Alice's company's flexibility and velocity is greater than Bob's.

Microservices also create a platform that allows us to use containers (docker, and so on). In microservices, orchestration and service discovery are very important to track the loosely coupled elements. A tool such as Kubernetes is used to manage the docker containers. Generally, it is a good practice to have a docker container for a microservice. Service discovery is the automatic detection of an IP address and other details on the fly. This removes the potential threat of hardcoding the stuff that is needed for microservices to consult each other.

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

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