Microservices architecture - tutorial for beginners

Duomly - Jul 21 '20 - - Dev Community

This article was originally published at https://www.blog.duomly.com/6-most-popular-backend-questions-and-answers-for-beginners/#what-is-microservices-architecture-tutorial


What are microservices?

Until now, the most popular way to develop applications was to build with the monolithic approach, which means that the UI and the data access code are combined together in a single software on a single platform. 

But when applications started to grow and became more complexed, developers began to use the microservices architecture, where the application is structured as a single-function module connected together. 

Let's get a closer look at the difference between the microservices architecture and the monolithic approach, and let's check what benefits and drawbacks can microservices architecture bring. 

In the image below, you can see the visualized difference between the microservices architecture and the monolith application. Microservices application consists of the few single services independent from the UI layers, and connect with it by the API gateway. Microservices are kind of separate applications, with their own database, and they can be connected to each other. 

Monolith vs Microservices

The main benefits of using microservices architecture are:

  • simple deployment, only the changed part of the software is affected by the deployment, so if something went wrong, just a part of the backend wouldn't work;

  • simple to understand, debug and modify, because if the software's functionalities are divided to a single function, it's much easier to understand it, find existing bugs and fix them, or add new features, then when it's connected to the other parts of applications;

  • reusable across the business, imagine that one microservice of the application, we are building for the corporate system is user login and registration, it can easily be reused in other applications;

  • ability to change easily, if there is another technology that developer would like to use in a project, there's no need to rebuild whole application at once;

  • better scalability, it's possible to scale up only the services that require that and scale down the services that don't require a big space, which can affect the cost of the application;

Like everything, even the microservices have some drawbacks, so let's see come of them:

  • the complexity of the architecture, even though during the building application it can be easier to understand and divide the task between the team, in the end, it can be much more complicated, with much more components and interconnections;

  • information barriers, while the application grows and has a lot of services. It can be difficult to handle information sharing, so developers have to put additional effort to implement a communication mechanism;

  • possible security issues, due to the multiple services and connecting them together there may occur some challenges with the security of our application;

Microservices architecture has many advantages over the monolithic architecture, but it has to be planned carefully so it won't make issues in the future.

Duomly - Programming Online Courses

Thank you for reading,
Anna from Duomly

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .