Architectures....Monolithic ,SOA,Microservices ....

·

4 min read

What is an Architecture ?

The process of defining a collection of hardware and software components and their interfaces to establish the framework for the development of a computer system.

Architectural Patterns ?

  • Monolithic Architecture

  • Service-oriented Architecture

  • Microservices

Monolithic Architecture-

image.png

credit -medium.com/design-microservices-architectur..

-In this all the components are tightly coupled and code is written in one place itself . This is a highly centralized application, and if any one of the components fails, the entire application breaks.

Single code based and single development when to use monolithic when we are not sure about future of app means when we are just starting our app. We can move from monolithic to SOA etc..

Advantages of Monolithic-

1.Faster response time when we want low latency and fast response time of website.

  1. Security is also important factor so managing the security of monolithic is easier than other architecture.
  2. Low latency - As i discussed earlier fast response time leads to low latency . 4.Integration testing is easier in this - When we want to create latency-sensitive applications like live video streaming applications. We can’t rely on more HTTP or gRPC calls on other services. If there is only one service then we have to only call internal methods and functions which is quite fast in providing the real-time experience.

Challenges-

  1. Low flexibility /time to functionality is slow- It means that if you are a frontend engineer and you are working on monolithic arch .You have to coordinate with backend engineer so if the backend person busy in some task and you say i have to do some changes in front end meanwhile you also have to help me to complete this task by adding backend changes .But that time if backend person says i am busy and i can't help you now .So this time your project will get stuck so interdependency is there .
  1. Slow deployment because if any change should be done either in FE OR BE will leads to do changes in both ends .This will leads to Slow deployment of project.

  2. Single point of failure

  3. Difficult to understand such a large codebase

  4. The Startup time of such applications is quite high
  5. Not Reliable: A bug in one component breaks the entire application
  6. Issue with scalability - Scalability is difficult in this because we if your onr module gets more than other like if FE is getting more request than BE ....we need to scale full application not single module we can scale here . Monolithic has many principles - DRY,KISS,YAGNI DRY -Don't repeat yourself YAGNI- You Ain’t Gonna Need It” KISS- Keep it simple and stupid

Service Oriented Architecture-corse grane

image.png

credit-https://www.google.com/url?sa=i&..

Service can be defined as a self-contained, smallest unit of functionality in a large software system that does not depend on the state of any other services and can fulfill a specific function.

In SOA, services are provided to other software components by application components through a communication protocol over a network like SOAP ,REST etc.

Service provider - Implements a service based on requirements and provides it to the end consumers. ● ### Service consumer - The requestor or client calls a service provider. ● Service locator - This is a service provider acting as a registry. ● Service broker - This acts as a mediocre, which is also a service provider but that passes service requests from consumers to one or more additional service providers. ● Service Communication Protocol allows the service provider and the service consumer to communicate.

Microservices Architecture-Fine grane Extension of SOA, where each service is more fine-grained and functionally independent of the other. ● These are mainly used to design complex applications and promote loose coupling between various app functionalities. ● Communicate with various other services through APIs to achieve a common business goal. ● These individual services have a different code base and are individually handled by another small set of developers. ● In contrast to SOA, we can see that each microservice has its database and independent components, whereas in SOA.

Faster Development ● Small Focussed Team of Developers ● Smaller Codebase ● New technologies can be easily integrated with the main application ● If a microservice goes down and the main application is handling the exceptions well, the entire application won’t break. ● It is easier to scale the main application by scaling each of the smaller microservices. ● Each microservice shares a different database, so if some schema update operation fails, it won’t break the entire database as various parts of the application are not touching or accessing data from a single database.