What is microservices and what it’s pro and con

Microservice Architecture, or microservice has become more common nowadays as it’s a distinctive method of developing and architecture your software system that widely adopted by the community and enterprise. In fact, even though there isn’t a whole lot out there on what it is and how to do it, for many developers it has become a preferred way of creating enterprise applications. Thanks to its scalability, this architectural method is considered particularly ideal when you have to enable support for a range of platforms and devices—spanning web, mobile, Internet of Things, and wearable – or simply when you’re not sure what kind of devices you’ll need to support in an increasingly cloudy future.

That’s is no a single standard or formal definition of microservices, but there are certain characteristics that help us to identify it’s as a microservice architecture design. When you designing your software with the microservice concept, you are actually splitting your whole process into multiple smaller functions / service which can run independently with it’s own programming language as well as database. Each of the process are communicate with other normally by using REST API.

The following diagram showing how’s the microservice being separated out from a big giant monilite system. Each of the service has it’s own database, they may develop using difference type of programming language, but all of them actually expose out the REST API for other service to consume it in order to completing a useful task.

With the separation of the function and database into individual service, you are actually achieving the loose coupling of your function, but the draw back is you may increase the complexity of your query. For example, the join query which previously you did in a single database call (sharing database), because of the database separation, you may trigger multiple API to get what the data that you wish to have in order for your next process.

 

Basically the following are some of the advantages which I can foresee to get by applying the microservice architecture:

  1. – Loose coupling of your code / function by separated it into multiple service
  2. – Easily manage your resources where you can allocated just enough resources for each of your service as you understand your code better
  3. – Code in the difference service can written in difference language, difference database product also can apply for difference service
  4. – Better fault isolation; if one microservice fails, the others will continue to work.
  5. – Easily integrate with the open source continuous integration and continuous deployment tools such as Jenkins
  6. – Easily deploy with docker container
  7. – Easily monitoring as each of the function are run independently
  8. – More frequent deployment as each of the service pretty small, can easily develop and deploy more frequent
  9. – More technology diversification as each service can be implement with the technology which work the best with the specific function

 

Microservice also come with some disadvantages:

  1. – More complex when the development team is small, more work need to be done as each service need to communicate via API
  2. – Testing become complicated as you need to link up multiple service in order to test the whole workflow
  3. – More database need to manage as each of the service have their own independent database
  4. – Need to understanding your system very well before you can module it into a useful isolated service

 

Some of the big company which apply the microservice architecture in their product

  1. – Spotify
  2. – Uber
  3. – Amazon
  4. Netflix
  5. – eBay

 

Microservice actually it’s not something new to the IT work, it’s soul was there for many years in the form of SOA (Service Oriented Architecture), web services. It’s just that start to gain the momentum in the recent year due to the few factors below:

  1. – Frustration at not getting the expected outcome from the architecture like monolith
  2. – Availability of tools and technologies to develop and deploying microservices application such as Docker Container, Kubenetes, Jenkins and so on
  3. – Wide adaptation of Infrastructure as a Server (IaaS) such as Amazon Web Services, Azure, Google Cloud Platform, it’s open opened up the door for the ease of DevOps operations
  4. – Big technology player also start the adaptation of microservices architecture

 

With the above advantages and disadvantages, I still believe microservice is a future prove architecture where everyone should look into it especially those people who are planning for the new and more maintainable system in a long run.

Leave a Reply

%d bloggers like this: