Introduction to Micro-Services

Roshan Alwis
Tech Vision
Published in
2 min readSep 2, 2017
Microservices.png

Introduction

Micro-service is a trending use case of today’s distributed systems. Systems that involves millions of users in their daily transactions. In early days we have used a monolithic architecture, that we built a system as a single unit. Components of the systems were tightly interconnected and interdependent on each other. Due to these reasons, system architects have faced a major problem in maintaining and expanding their services with time. Because in order to maintain the system we had to stop all the current services and do it. This simply reduces the availability of the service to the user. On the other hand, if the system is large and complex to understand, it is difficult to integrate new features or sometimes end up with rewriting the whole application.

In this article we are looking at Micro-service architecture, how it has been evolved and its strength and weaknesses.

What is a Micro-service?

Micro-service is an another architectural style that motivates us to develop systems as a set small services with specific scope, less scale, able to work on their own and communicate with other services through message passing. More oftenly these communications occur as HTTP requests. Decision of decoupling a large system into set of micro-services is based on the business objectives and ability deploy them independently. As a best practice micro-service mange their data source on their own.

Monolithic vs Micro-service Architecture

According to the above diagram you can clearly visualize how it works. In monolithic architecture it tends to put all its functionality into single process and replicate those processes in multiple instances. But in micro-service architecture, each functionality would be assigned to a separate service and then distribute and replicate as it required.

Let’s now look in to the Pros and Cons of this approach,

Pros

  1. Easily deployable.
  2. A Micro-service can be upgraded or maintained without affecting other services.
  3. Can be scaled easily.
  4. Micro-services are light scale and has a specific scope which avoids lengthy production cycles.
  5. We can use different languages to implement different services. e.g. Python, Java.

Cons

  1. Communication overhead including HTTP calls and (de)serialization.
  2. Have to rely on communication network.
  3. Debugging at implementation phase could be complex.
  4. Each service has to be managed with their own configurations (Increase configuration management).

--

--

Roshan Alwis
Roshan Alwis

Written by Roshan Alwis

Software Engineer at Sysco Labs. (Computer Science & Engineering Graduand at University of Moratuwa)