Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What is Microservice & Monolithic Architectures?

What is Microservice and Monolithic Architectures?

By: contentstack

Functional Requirements:

what Application is delivering to the end-user

  • what type of application is it(heavy traffic or low traffic).
  • No of functionalities.(or components)
  • Who are the end-users

Resource Availability:

  • Time frame
  • Engineering resources.(Experienced developers)
  • Financial resources.

Every app has the three main tires that exist in every architecture whether the app is built on a monolith architecture or the microservice architecture and that are:

  1. UI (User Interface): This tier handles the http request from the user and returns a response.
  2. Business Logic: Contains the main logic of the app by which the service is provided to the users.
  3. Data Layer: This layer implements the data storage and the access of the elements.

Why microservice architecture was needed?

To understand this question we need to understand first what is the monolith architecture and what were the problems with it that led to the microservice approach and now it is most used approach for software development.

Monolith Architecture

It is an architecture approach in which the whole application is managed as a single unit and the whole application is deployed using the single binary. In which all the three tires are there: UI, Business Logic, Data layer.

Advantages of monolithic approach:

  1. Development process is easier.
  2. Very easy to deploy as single binary is used when compared to microservice as many technologies are used in deployment like docker, kubernetes, etc.
  3. There is less network problem and security issues as compared to microservice but it doesn’t mean microservice approach will have a lot of latency and will be slow.

Disadvantages that led us to microservice approach:

  1. If there are to be changes done in any one of them then the whole application needs to be redeployed.
  2. Whole application becomes very heavy with time and becomes difficult to manage.
  3. As the application becomes heavy deployment time and start time increases.
  4. Horizontal scaling is not feasible as If any one part of the application is facing huge traffic then the whole application needs to be duplicated in multiple servers which is inefficient and resources will be used unnecessarily leading to more cost.
  5. Whole application would be built using single language and we can’t use multiple language which suits best for specific functionality.
  6. If there is bug in any one of the tier then whole application would be down as it is deployed using single binary.

Because of all the above listed disadvantages, microservice architecture is used.

Microservice Architecture

It is an architecture approach in which a single application is comprised of many small loosely coupled standalone(Every service has it’s own tech stack) and independent deployable services which talk to each other through the API.

Every microservice has all the below mentioned characteristic of its own:

  1. Has it owns repository.
  2. Made using the programming language that suits the best.
  3. APIs to communicate to other microservices.
  4. Deployed using its own binary.

Advantages of Microservice Approach

  1. If one specific microservice is buggy then only that specific service needs to be redeployed not all of them.
  2. Microservices are small in size as every functionality is detached and has its own microservice where as in monolithic whole application is there.
  3. Each microservice can use it’s own tech-stack independent of other services.
  4. If one of the microservice is facing large traffic that it can be replicated and traffic could be distributed which saves a lot of resources with zero downtime.
  5. If one microservice goes down then whole application won’t shut and other parts of the application would be working.

Disadvantages of Microservice Architecture

  1. Security issue as each of the independent service need to communicate with each other using APIs it is more prone to attack or breaches.
  2. Complexity is way more than monolithic as many components are there and the deployment and managing of these services are task in itself.
  3. Debugging is difficult as many services are there so finding point of failures takes a bit of time.

As we saw each architecture has it’s own trade-offs that needs to be considered at the genesis of a project. There is no “golden path” in deciding the architecture for a project but a good understanding of both the architecture will provide the clear project roadmap. But more importantly, it is to be understand that how application will be maintained in different scenarios like high traffic, scalability, multiple release, etc.


What is Microservice & Monolithic Architectures? was originally published in TechManyu on Medium, where people are continuing the conversation by highlighting and responding to this story.



This post first appeared on TechManyu, please read the originial post: here

Share the post

What is Microservice & Monolithic Architectures?

×

Subscribe to Techmanyu

Get updates delivered right to your inbox!

Thank you for your subscription

×