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.

To view or add a comment, sign in

More articles by Aqib Javed

  • Adversarial Machine Learning

    Abstract Artificial Intelligence (AI) is omnipresent and has become ubiquitous across many fields like finance…

    4 Comments
  • Logistic Regression and Interpretability

    Logistic regression is one of the most widely used algorithms for binary classification problems, such as predicting…

    4 Comments
  • Explainable Artificial Intelligence (XAI)

    Abstract Artificial Intelligence (AI) has become ubiquitous across various domains, including industry, economics…

    5 Comments
  • Backpropagation in Neural Networks

    In machine learning, artificial neural networks, also known as neural nets (abbreviated as ANN or NN), are a…

    13 Comments
  • Handwritten Digit Recognition with Deep Learning

    Deep learning has become one of the most powerful tools in the field of artificial intelligence. From powering…

    7 Comments
  • Genetic Algorithm

    Introduction Genetic algorithms (GAs) are a powerful class of search heuristics widely used in artificial intelligence…

    6 Comments
  • A Beginner's Guide to Probability and Bayesian Reasoning in Python

    Background Probability theory is the mathematical framework for quantifying uncertainty and making decisions under…

  • Uninformed Search Algorithms In AI

    A search algorithm is used to search a problem as input and gives us a solution to that search or an indication of…

    3 Comments
  • Types of AI Agents

    We interact with AI every day without realising it. From recommendation systems for personal preference to self-driving…

    6 Comments
  • Agents & Environments

    An agent is anything that perceives its environment through sensors, processes the information, and takes actions…

Others also viewed

Explore content categories