Monolithic vs. SOA vs. Microservices

Monolithic vs. SOA vs. Microservices

Creating a new project is always a pain and its success is always a question that how can we make it, maintain it and intensify it in future. The progress of a project directly depends upon the building blocks and architecture which we choose to make it. There are a couple of architecture popularly used in the development of a new project like monolithic, service-oriented architecture and microservices architecture. Let's see what are those architecture and deep dive into those for more depth understanding.

Monolithic Architecture

Monolithic architecture is a concept when complete software is developed as a single unit. All functionality, features and modules are developed and integrate and deployed in the form of a single entity. A single platform containing user interface, business logic and database layer on the same page. Monolithic application has a single shared database for each functionality and every feature combined in a single program as a unified model.

A monolithic architecture is comfortable and easily adopted by small teams and small projects. A lot of startups and small projects are used to developed using monolithic architecture. Its good for a project when the modules are interdependent and interconnected.

Monolithic architecture has some cons and prons. In prons, monolithic architecture is easy to deploy as in the end it is deployed as a single, solid entity. Monolithic architecture has less common utilities, so if we are implementing this architecture we have very few cross-cutting concerns. Monolithic application somehow have better and fast performance as there are very minimal or sometimes no call for API's, modules are close to each other and in a single entity, existence makes them pretty fast.

The biggest con of monolithic architecture is fault tolerance. As monolithic worked as a single unit and if there is an issue in a simple tiny feature whole application will stop working because the application is always deployed as a single unit. When the application becomes large and big, it becomes complex and difficult to main in the monolithic architecture, as a single change can make us test the complete application and it is always time-consuming. Monolithic architecture decrease agility, as a tiny update and feature development always required a full deployment. Upgrade, like technology upgrade, is a pain in monolithic architecture and most of the time it is avoided.

No alt text provided for this image


Service-oriented architecture

Service-oriented architecture some time is also known as centralized oriented architecture, is architecture when multiple, services which are also said as user agents are used or created interaction with a centralized system to make our traditional monolithic less burden and loosely coupled. A service-oriented architecture is specifically designed to communicate interoperable systems. Each service provides functionality on abstraction level, consider as a black box, self-contained to avoid the overhead of new development each time.

Service are abstract and can be developed on any technology. The communication between them can be done using a central point of connectivity called Enterprise service bus. ESB is taking care of all service and helping them to interact with each other.

SOA has its pros and cons, as SOA provide us, reusability of all those independent services, for example, if we need to make a login authentication module, instead of doing from start we can use facebook/google authentication service in SOA. Somehow SOA heterogeneous services make our system fault tolerance. If a single service is not working, our complete system will not turn down. The biggest benefit of SOA is service reusability if we created a service it always can use again in new developments.

One of the cons in SOA is the overhead on ESB, change in a service cause change in ESB, as well. ESB is a SPOF if it's down or damage whole application will be down. Multiple services also increase overhead and response time. SOA is good for enterprise-level application.

No alt text provided for this image

Microservice Architecture

Microservice architecture also considers as decentralised architecture, is much similar to SOA but not connected with any central service. Microservice architecture is an architecture which is build using autonomous services which communicate with each other using rest. Like SOA microservice not build on such service which can use again any other project as well instead its focus is to make each functionality separate as a service which should be micro and a self-contained, application, business, infrastructure and enterprise layer. Each service unit has its database.

All those microservice then join into UI microservice to show as a working application. From UI we call those microservices through rest calls.

No alt text provided for this image

In a microservice architecture, we have a couple of concepts, to discover service, so that other services can communicate with each other, as we know each component or small functionality is developed as a microservice and they need to communicate with each other to work properly. Each microservice have its database model which is independent, and those communicate with other services when need.

We have a lot of challenges if we use microservice architecture, for example, every service is independent and somehow they need to communicate with each other. For example, we are building an application for Music catalogues which provide us with information regarding tracks we have with its ratings, now we have different service for music details and different service for rating information, and our music catalogue service needs to communicate somehow with other two services to provide a final result. Like SOA we do not have any ESB which helps us to make those services interact with each other.

Service Registry

All microservices register themselves with a single server, which is called service registry, we have a couple of discovery servers used for that purpose. Netflix Eureka server is one of the options.

Service Discovery

When microservices need to communicate with each other they contact with naming server/ discovery server to occupy details like IP and port of that service, this concept is called service discovery.

Besides the above, like every service architecture, we need to implement a few things like load balancing, fault tolerance, API gateways, health checks etc and we have a couple of frameworks for that. Microservices have a couple of cons as well as prons. One of the biggest pron is easy deployment, development and test. Its support agility and continuous development. We do not have any dependency while working on individual service. Highly scalable and fault tolerance. Some of the cons are system slow performance sometimes as central service is calling a lot of services. Just like SOA, microservices are also good for enterprise-level of projects.

Conclusion

It's always a wise and difficult choice, to choose a style of architecture for the development of a new product which comes with experience. In this article, we have seen some differences in between Monolithic, SOA and microservice architecture. We see which architecture suits which type and size of the project. We also see some pros and cons of each architecture. We also observe some concepts like service registry and fetch registry required in a microservice architecture.

要查看或添加评论,请登录

Aqib Javed的更多文章

  • Air Traffic Coordination Algorithm

    Air Traffic Coordination Algorithm

    The closest pair of points problem is a computational geometry problem. Given n points in a metric (2D space), find a…

  • Quagmire of N Queens Problem

    Quagmire of N Queens Problem

    The N-Queens problem is a prototypical backtracking problem that involves placing N queens on an N × N chessboard in…

  • Create Smaller Docker Images For Spring Boot Using JLink

    Create Smaller Docker Images For Spring Boot Using JLink

    Containers revolutionise software development and deployment by providing unparalleled flexibility and agility…

    1 条评论
  • Graphs in Java

    Graphs in Java

    The prerequisite of this article is an Introduction To Graph. Please go through that article first before proceeding…

    4 条评论
  • Introduction To Graphs

    Introduction To Graphs

    Graphs are one of the fundamental data structures in computer science. They play a vital role in solving complex…

    2 条评论
  • Vector vs ArrayList

    Vector vs ArrayList

    Introduction Arrays are one of the fundamental components of data structures. They play a vital role in solving…

    2 条评论
  • Finding Median Of Two Sorted Arrays

    Finding Median Of Two Sorted Arrays

    As part of our series on algorithms and data structures, today we are going to solve a very interesting problem that…

  • Hashtable vs HashMap

    Hashtable vs HashMap

    Introduction One of the most frequently asked interview questions at the entry-level is about HashMaps and Hashtables:…

    1 条评论
  • Bit Operations in Java

    Bit Operations in Java

    No doubt Java is a strong language, with its great architecture, providing write once and run anywhere with object…

  • Microservices using spring cloud

    Microservices using spring cloud

    Microservice architecture, with its great advantages and flexibilities, besides all agility support also bring huge…

社区洞察

其他会员也浏览了