Search This Blog

Tuesday, 7 February 2023

The Modern Monolithic N-Tier distributed deployment Architecture used Today

 

The N-TIER Architecture and its Deployment Perspective for Web Apps

 

 




The N-Tier architecture above is used in most enterprise applications even today. The presentation Layer of an application has different forms of presentation such as presenting the product UI as a desktop App, as Mobile App and as a Web App at the same time. All these three presentation forms of the product are deployed on different servers but are in sync with the same Business Logic Layer and replications of the Database (Data Storage in above diagram)

This introduces a neutral layer known as the Services layer which become the common point of communication between the different presentation layers and the common server-side business logic.

The Presentation layer is also become complex owing to the usage of different client-side technologies that are built on architecture patterns such as MVC, MVP, MVVP, Prototype etc.

Hence the presentation layer gets further divided into n-tiers, namely the

1.       Html / UI Layer: Has dedicated UI developers who work on HTML based Languages (Polymer, JSX, React) & CSS Based Languages (LESS, SASS)

2.       Presentation Business Logic Layer: Has dedicated Front-end developers who work on Object Oriented Javascript based technologies

3.       Presentation Services Layer: Has dedicated Front-end developers who write client service classes to consume server side services-layer

When the N-Tier architecture is analysed from the deployment perspective, then it results in deployment architectures such as

1. Monolithic

2. Microservices

3. Micro-Kernel

and so on.

Let's stick to transforming the above n-tier architecture into a hybrid or enhanced monolith deployment.

Here, it looks similar to a distributed architecture of deployment, but the reason one can say its enhanced monolith is because, even with additional releases the total number of servers used in the deployment stay constant.

The current age monolithic architecture, is hybrid, considering the Presentation Layer becoming polyglotic, meaning the presentation layer uses more than one technology stacks, frameworks, languages.

A lot of times, our product has multiple UI interfaces like Web UI, Mobile App (Android, iOS, TvOS), Desktop App. All these UI apps could be synchronized to the same database data, the same business logic.

When the presentation layer becomes polyglotic, the deployment cannot be done on a single server always. Eg: The mobile App requires to be deployed to the respective vendor's cloud store, while the desktop app should be deployed on individual customer workstations, while the web app could be deployed on the enterprise's  own servers. 

Irrespective of the above, all of the data is synced with the same business logic and database. In this case, a pure monolithic architecture cannot be used as a pattern for deployment.

Converting the above development view of N-Tier Architecture to the Deployment View, of a modified / enhanced monolithic. The total number of servers in this distributed monolith will always be constant, even with additional releases of the product.



For each deployed node (server), today, a secondary node is attached, so that it eases managing failures and deploying the parts of the product. Hence to every node (active or primary) a secondary node is attached.


When a deployment is made, the deployment is done to the secondary node, and then synced with the primary node. The secondary node is made active for a few seconds until the primary node is synced with the latest deployment. After this a smooth switch is made so that the primary node now becomes active.

Hence for every server on which deployment is done, a secondary server is always attached, but is not active. This node is used for seamless switch while deployments are done and when the primary node for some reason fails.

A standard architectural solution for this is High Availability, which helps in the seamless switch after the new deployments are done on the primary and secondary node, such that the end customer / user using your app, is not affected.


Hope this helps you in your quest!

No comments:

Post a Comment