Talking to… João Duarte about microservices and their advantages

Author LOQR

João Duarte joined LOQR in early 2016 as a Backend Developer. In this position, he worked on developing the first service API and, later, on the first microservice of the company. Now, he is currently working as a Site Reliability Engineer (SRE).

João, why did you choose to talk about microservices?

I decided to address this topic because, in addition to being a topic with a lot of visibility and interest in our scene, it is part of the genesis of LOQR. Our entire technological stack and architecture are based on these principles. So, I wanted to share a little of what we do so well in our day-to-day lives at LOQR.

Let me start with a fun fact that anyone who knew me in college knows: I hated docker, containers, and any other related tech. I believe that I didn’t quite know yet what it was about and had a completely unfounded opinion on the subject. Later, when I started to “get my hands dirty,” I began to agree with those who advised me and understood the reasons for their success.

Can you tell us more about microservices?

The introduction of new paradigms in recent decades, such as software modularization, layered applications, and even with the introduction of the “loosely coupled, highly cohesive” (LC/HC) paradigm, came, in a way, to shift the mindset of those who did the development, management, and deployment of these applications.

Unlike a completely monolithic application, in which it concentrates all the business and operation logic in itself, a modular application that follows the LC/HC philosophy says that its dependencies should be as small as possible. So, each service will have to be as independent as possible (loosely coupled), and at the same time, try to focus only on a very concrete logic or action. It should only know how to execute/process a certain set of well-defined instructions and a concise scope.

In other words, a microservice is an almost atomic unit of a distributed software system, with few dependencies and capable of executing or processing a very simple logic. A simple analogy to understand its functioning would be a beehive: each cocoon is independent. However, the set of several cocoons is what gives the comb its structural resistance. If something happens to one of the cocoons, it will not affect the others; we have redundancy and fault tolerance.

However, as with any other solution, there are also some disadvantages:

– It is very costly to start an architecture from scratch;

– It is more difficult to test in a distributed environment;

– With the increase of the number of services, their management efforts will also increase;

– It is necessary to have a well-structured and prepared network to ensure an adequate load balancing, fault tolerance, and high availability (API Gateway);

In general, these problems are easy to overcome, and there are more advantages than inconveniences.  

Has containerization revolutionized microservices?

There is no doubt that the invention of containerization, Docker, Kubernetes, and Mesos has solved many of the adversities of infrastructure management and maintenance in a company, especially the reduction of costs associated with them. I would even say that the technological leap was so huge that we will still be navigating through unnavigated seas for some time. 

It was the invention of this that brought the necessary abstraction for sustained scalability. Nowadays, we can quickly implement hundreds of microservices in different programming languages, talking to each other through standard protocols, divided into different geographies, which gives tremendous flexibility to teams that develop these services and, above all, those who operate them.

Do you believe that the adoption of this architecture has made a difference to LOQR?

This was, without a doubt, the most significant and most correct decision ever made in the company. That’s what allowed LOQR to grow technologically so fast.

As I am part of the company’s SRE team, I can say that we can manage in a unified way, an architecture composed of thousands of services with a moderate or even small effort, that is, when everything works well.

We gained incredible know-how in a short time. When we launched our first microservice, it was literally like loading a container onto a ship and watching it set sail off the coast to an ocean that we certainly didn’t know its size and depth to this day.

What are the main challenges you foresee?

Certainly, LOQR and its teams will always be prepared for what is yet to come. However, with our growth to other latitudes and geographies, some more demanding challenges will certainly arise. Still, very shortly, LOQR will be known in the market as a pioneer and evangelist of these technologies.

I am particularly proud to have been part of the team that assembled the first “cargo dock,” brought the “ships,” built the first “container,” and with the help of this multifaceted team, we built the first “crane” to place the container on the ship and make it float in the ocean. I sincerely hope that in a few years, I can still say what it took me so much to “fit in” and understand and transmit this knowledge to everyone who once did and will be part of this family that is LOQR.

João, if you had to define LOQR in one sentence, which would it be?

LOQR will always be where I will learn, practice, and convince myself of the best standards in the technological market.