Friday, November 17, 2023

Lift And Shift of Monolith Group Of Architecture Patterns

Lift And Shift Of Monolith


 

History

Developer community is busy with Digital Transformation & Application Modernization activities. There are many projects where huge resources are invested to convert Java Monolith Applications into Microservices. The Goal is to realize a cloud native application, which can be scaled individually, manageable by a feasible sized team and is responsive.

We see many articles which talks about "Lift and Shift" of Applications when you move from on-premises to public clouds, but they don't help you when it comes to Monolith Application.

Since 2016, we focused on solving this challenge and find out a way to enable "Lift And Shift of Monolith". We identified the challenges and prepared a strategy around this. Finally, we came up with our first Best Practices which was foundation towards achieving our Automation Goal of Lift And Shift and was published under the heading of Application Modernization in 2019.

We involved into heavy development activities and came up with our first application which demonstrated the Automation using which we can quickly Lift And Shift Monolith class into Microservice. We also hosted an Opensource project with this code so that the developer community can get benefited with this innovation. The user guide and tutorial for the same was nicely described under the Heading Monolith to Hybrid Architecture in 1 Hour. in 2020.

The enhancement of our Tool continued and by 2023, we have deployed the tool on the cloud and is made available as SAAS to our clients, with extensive functionalities.

We identified the Architecture Patterns which can solve the complexities involved in the "Lift And Shift of Monolith", hence it gave birth to "Lift And Shift of Monolith" Group of Architecture Patterns.


Problems addressed

You can transition from Monolith to Hybrid using Strangler Pattern.
 
While Hybrid Architecture allows you to use Monolith Application and it is one of the component within Modernization, arriving to that state has its own challenges, which can be listed as follows:
  1. Manual modification of Monolith App code is time consuming.
  2. Executing modified code of Monolith App involves more than trivial efforts.
  3. Realization of benefits of Hybrid Architecture is realized only after substantial effort and time is invested over the transition of the Monolith Application. 
  4. Inter-Service communication and Monolith communication channels can add complexity to the Architecture.
  5. We need to save our Architecture from implementing Anti-patterns.
We want to break a Monolith Application into A Hybrid Architecture. This approach can be as complex as the Application itself, while very simple at Microlevel.

Monolith Application is primarily complex with respect to Architecture for:

  1. Monolith Application has huge code base.
  2. Individual Classes( DAO, VO, Service, etc) are tightly coupled
  3. The VM for their execution is generally shared.
  4. Analysis & Mapping of dependencies takes huge efforts.
  5. Vertical Slicing becomes very complex and iterative due to coupling.

 Unique Approach to Transformation

We want to break a Monolith Application into A Hybrid Architecture. This approach can be as complex as the Application itself, while very simple at Microlevel.

Monolith Application is primarily complex with respect to Architecture for:

  1. Monolith Application has huge code base.
  2. Individual Classes( DAO, VO, Service, etc) are tightly coupled
  3. The VM for their execution is generally shared.
  4. Analysis & Mapping of dependencies takes huge efforts.
  5. Vertical Slicing becomes very complex and iterative due to coupling.

 

How we solve the Problems

We identified best practices and other solutions and came up with a Strategy to minimize the risk and quickly realize Hybrid Architecture.

  1. Take Bottom-To-Top Approach
  2. No Change in Efferent Coupling of the Class
  3. Add Webclient to Dependee Class
  4. Expose Dependee Class over REST
  5. Use Stripped Monolith Application with MVC Wrapper Application
 This strategy is documented in detail at Monolith To Hybrid Strategy
 

Birth of "Lift And Shift of Monolith" Group of Architecture Patterns

 

  1. Wrapper Controller: Responsible to expose Monolith over REST API.
  2. Monolith Class Bridge: Facilitates Communication between Wrapper Controller and the Monolith Class.
  3. Monolith Controller Client: Responsible for maintaining Efferent Coupling of other classes of the Monolith and making REST Call to Wrapper Controller.

Initial Architecture

Fig 1: We have Class A, B &C within our Monolith Application. For Vertical slicing, if we process Class B, keeping its structure intact, Monolith Application can still function with modified class.

Target Architecture with applied Patterns



Fig 2: We have Class A, B &C within our Hybrid Application. Vertical slicing of Class B. Wrapper Controller, Monolith Class Bridge & Monolith Controller Client are introduced to the architecture.

 

 

Lift And Shift of Monolith" Group of Architecture Patterns in Action

This pattern is used by Digital Transformation Tools. You can refer to below videos to understand how this pattern helps in Digital Transformation.


1) CodaGeeks Digital Transform Tool:
This Tool helps you to transform your Java Monolith Class into Microservice. This tool is also available as an service ( SAAS ). Refer http://www.codageeks.com for more details.

 
 
 
 
       2)  Miracle Open Transform:
     This is an Open Source project hosted on git hub. It has code which               implements this and other "Lift and Shift Monolith" group of patterns.






What is an Architectural Pattern?

According to Wikipedia,

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope.

At Miracle Labs, we constantly innovate around real time problems and try to find solutions. While we were attempting early Digital Transformation Projects, we solved complex problems.










Monolith Controller Client

Monolith Controller Client Pattern

Monolith Controller Client Pattern solves complexity involved in exposing a Monolith Java Class into Rest API. By using this pattern, you can easily execute the Monolith Code ( Methods ) as service end points. It ensures that your other classes of Monolith Application are working seamlessly and are able to call the methods of the sliced Monolith Java Class without any modification, after you perform Lift and Shift of the Monolith Class.

This is part of "Lift & Shift of Monolith " Group of Architecture Patterns.

Problems addressed

Below are the problems that you face when you want to slice a single Java Class from a Monolith App.

  1. If you change the syntax ( Name or parameters) of methods of the Java class, it will break the consumer classes and you have to rewrite them as well. The Efferent and Ifferent Coupling will break.

  2. It will become mandatory for you change each and every dependent class, which will be a huge effort.    

 How we solve the Problems

  1. We implement "Monolith Controller Client " Pattern. This class  will have the same method syntax of each public method of the Java Monolith Class. This includes Getter and Setters as well as service methods ( Business Functions )

  2. We replace the body of the Monolith Java Class with this Monolith Controller Client class. This class is capable of calling the "Wrapper Controller" for executing the monolith class methods remotely.
     
  3. The "Monolith Controller Client" is helped by Json Convertors which converts the method data types to Json and vise-versa so that it can send and receive parameters over the REST API Calls.
     
  4.  The "Monolith Controller Client" ensures that all dependent classes are still able to call the monolith class methods without any change.

Monolith Controller Client Architecture Pattern in Action

This pattern is used by Digital Transformation Tools. You can refer to below videos to understand how this pattern helps in Digital Transformation.


1) CodaGeeks Digital Transform Tool:
This Tool helps you to transform your Java Monolith Class into Microservice. This tool is also available as an service ( SAAS ). Refer http://www.codageeks.com for more details.

 
 
 
 
       2)  Miracle Open Transform:
     This is an Open Source project hosted on git hub. It has code which               implements this and other "Lift and Shift Monolith" group of patterns.






What is an Architectural Pattern?

According to Wikipedia,

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope.

At Miracle Labs, we constantly innovate around real time problems and try to find solutions. While we were attempting early Digital Transformation Projects, we solved complex problems.










Monolith Class Bridge Pattern

Monolith Class Bridge Pattern

Monolith Class Bridge Pattern solves complexity involved in exposing a Monolith Java Class into Rest API. By using this pattern, you can easily execute the Monolith Code ( Methods ) as service end points. It ensures that "Wrapper Controller" is seamlessly able to call the methods of the sliced Monolith Java Class. This enables the request response of the remote calls. You can then realize all benefits of the cloud application for your same monolith code.

This is part of "Lift & Shift of Monolith " Group of Architecture Patterns.

Problems addressed

Below are the problems that you face when you want to expose a single Java Class from a Monolith App as Rest API.

  1. If you change the syntax ( Name or parameters) of methods of the Java class, it will break the consumer classes and you have to rewrite them as well.

  2. The formal data types of the parameters of the methods are not directly supported for Request / Response, as required by REST API best practicies.
       

 How we solve the Problems

  1. We implement "Wrapper Controller " Pattern. The REST Controller will have an unique end point, corresponding to each public method of the Java Monolith Class. This includes Getter and Setters as well as service methods ( Business Functions )

  2. We add "Monolith Class Bridge" Java class to the application. This class acts as a bridge for the conversion of datatype of request payload and response body to the datatypes matching to the method parameters and there return types.
     
  3. Monolith Class Bridge is linked to the "Wrapper Controller", hence all the upstream requests received by the "Wrapper Controller" are forwarded to Monolith Class Bridge, which delagtes the call to the actual Monolith Class and captures the result of the method being called.
     
  4. Monolith Class Bridge is then responsible of converting the result of the method call into the required Json string such that controller can send it back as the Response.

Monolith Class Bridge Architecture Pattern in Action

This pattern is used by Digital Transformation Tools. You can refer to below videos to understand how this pattern helps in Digital Transformation.


1) CodaGeeks Digital Transform Tool:
This Tool helps you to transform your Java Monolith Class into Microservice. This tool is also available as an service ( SAAS ). Refer http://www.codageeks.com for more details.

 
 
 
 
       2)  Miracle Open Transform:
     This is an Open Source project hosted on git hub. It has code which               implements this and other "Lift and Shift Monolith" group of patterns.






What is an Architectural Pattern?

According to Wikipedia,

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope.

At Miracle Labs, we constantly innovate around real time problems and try to find solutions. While we were attempting early Digital Transformation Projects, we solved complex problems.










Wrapper Controller Architecture Pattern

Wrapper Controller Architecture Pattern

Wrapper Controller Architecture Pattern solves complexity involved in exposing a Monolith Java Class into Rest API. By using this pattern, you can easily execute the Monolith Code ( Methods ) as service end points. Thus you can add this Rest API as Microservice within your cloud applications. You can then realize all benefits of the cloud application for your same monolith code.

This is part of "Lift & Shift of Monolith " Group of Architecture Patterns.

Problems addressed

Below are the problems that you face when you want to expose a single Java Class from a Monolith App as Rest API.

  1. You cannot scale out a single Java class from Monolith Application

  2. If you change the syntax ( Name or parameters) of methods of the Java class, it will break the consumer classes and you have to rewrite them as well.

  3. The formal data types of the parameters of the methods are not directly supported for Request / Response over Rest API
       
  4. We cannot slice a Java class from Monolith as it is A Single JVM Application

 How we solve the Problems

  1. We create a serverless application ( Spring Boot / Thorntail ) and add a REST Controller to the application and the Monolith Jar.

  2. The REST Controller will have an unique end point, corresponding to each public method of the Java Monolith Class. This includes Getter and Setters as well as service methods ( Business Functions )

  3. Call to REST Endpoints will further propagate to the Java Monolith Class. We wire the Java Monolith Class ( as service ) to this Controller Class

Wrapper Controller Architecture Pattern in Action

This pattern is used by Digital Transformation Tools. You can refer to below videos to understand how this pattern helps in Digital Transformation.


1) CodaGeeks Digital Transform Tool:
This Tool helps you to transform your Java Monolith Class into Microservice. This tool is also available as an service ( SAAS ). Refer http://www.codageeks.com for more details.

 
 
 
 
       2)  Miracle Open Transform:
     This is an Open Source project hosted on git hub. It has code which               implements this and other "Lift and Shift Monolith" group of patterns.






What is an Architectural Pattern?

According to Wikipedia,

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope.

At Miracle Labs, we constantly innovate around real time problems and try to find solutions. While we were attempting early Digital Transformation Projects, we solved complex problems.