Looking into the use and benefits of Microservices

Roberto Fernández
Empathy.co
Published in
2 min readSep 11, 2018

What are Microservices?

Microservices are a relatively new type of software development paradigm. They consist of services that run independently and autonomously but that have the ability to collaborate with each other to form a complete application. Each service normally displays its functionality through a REST API and exchange HTTP messages in JSON format to interact.

These types of microservices are often used to solve the problems that can arise with monolithic applications that are usually built on a single core, with the same language and several modules that have a great mutual dependence on each other.

When you work with microservices, as each service can be independent, it means we can increase the scalability and decrease the dependency between modules and facilitate their maintenance.

Some key benefits of this architecture are:

  • Services are smaller, more understandable and easily testable. “Do one thing and do it well.”
  • Technologically independent. Services can be deployed independently using the language that best suits the requirements.
  • Ease of development. With microservices it’s possible to change only one service and deploy it independently of the rest of the system. Whereas, for example, a monolithic application requires the deployment of an entire application to release the change.
  • Improves code reuse. It allows for functionality to be consumed in different ways for different purposes.
  • Ease of isolating bugs or faults. For example, if there is a problem in one service then only that service will be affected. The other services will continue running. In a monolithic architecture, the problem in one component can bring down the entire system.
  • Offers greater horizontal scalability. With smaller services, it’s possible to scale only the services that need scaling.

There are of course some drawbacks from these systems too:

  • Increased configuration management. Each service has to have a dedicated build, maven, GIT, Jenkins, etc…
  • Integration testing can become more difficult.
  • Difficulty to maintain the integrity of transactions.
  • Monitoring and logging. It’s necessary to have a centralized view of the system and centralized logs to find problems.
  • Increased memory consumption. More hardware resources are needed for the same workload in a monolithic architecture.
  • Less comfortable API. Making HTTP requests and processing them is more laborious than doing a programmatic method call.
  • Cascading failure: Since the communication is remote, the code has to be robust to handle partial failures.

In general, a microservices architecture is highly beneficial for use in larger applications specially, so you can scale different components in different ways, both regarding hardware and number of team members supporting the components. Under these circumstances, this architecture is recommendable and will be very helpful.

--

--