Modernizing Monolithic Application: Key Aspects
Latest technology trends are enabling organizations to transform digitally; this disrupts the IT model, improves business efficiency, and reduces the cost. It is significant for an organization to take advantage of these trends and transform monolithic applications into modern applications. Here are some concerns related to monolithic applications:
- Tightly coupled functionalities.
- Inadaptability towards the changes in business requirements.
- Outdated Architecture and Design.
- Technology stack is obsoleted and difficult to upgrade and maintain.
- Limited scope in implementing non-functional requirements.
- High Infrastructure and platform dependency.
These concerns lead to extra IT expenditures.
- The cost of updates in monolithic applications is high due to inter-component dependency. A small change in an application requires a complete rebuild, recompilation, additional testing, and application downtime; these impact product delivery time. A specific skill set is required to maintain such applications, however, people with these skills are difficult to retain. Therefore, frequent functional changes, incorporation of compliance, and regulatory guidelines come with high cost.
- In order to maintain applications on multiple servers, companies must invest large sums of money. Since such monolithic applications are tightly coupled on specific infrastructure/configuration, they are more expensive as compared to modern infrastructure. Monolithic applications are also more vulnerable to cyber threats and are incompatible with security patches; they require more maintenance and support.
- Outdated or proprietary technology stack limits the possibility of cost optimization, such as third party service integration and adoption of open source tools/framework/API.
Monolithic vs Microservice:
Functionalities are tightly coupled in a monolithic application. A minor change in the application leads to a rebuild and redeploy of the entire application which is overhead and subsequently adds the cost.
Transforming monolithic application into groups of microservices requires decoupling of the functionalities which is based on a domain-driven design. Each functionality is exposed as an autonomous service having small size, dedicated data, and no dependency which helps in fast independent release cycle resulting in cost optimization.
Key advantages of modernizing the application.
- One of the major benefits is revenue growth, as there is continuous delivery and better user experience.
- Flexibility to develop autonomous services based on domain-driven design.
- High resiliency and scalability.
- Technology flexibility, variety of commercial/open source technology can be used to develop robust applications.
- Aligned to Agile and DevOps culture.
The strategy to modernize monolithic applications should be incremental since there may be a possibility of the transformation process going wrong. Decomposing functionalities should be the primary objective along with code refactoring so that each application’s functionality can be deployed as an autonomous service. This can be scaled, managed and operated independently.
Following steps can be considered in modernizing the monolithic applications.
Assessment:
Application’s assessment in areas as depicted plays a vital role in identifying the feasible approach. It is important to identify issues, concerns, and limitations in these areas with relevant stakeholders.
Approach:
Based on the assessments and objectives, identify what is best fit for the target system. It may lead to complete transformation, covering multiple phases (re-architecture, functional decomposition, re-building, etc.) or a specific phase i.e. encapsulation (where an existing functionality with minimum changes is encapsulated and exposed as service) as depicted in diagram.
Operational Readiness:
It is imperative to have a tech ecosystem for continuous delivery. This is required for modernizing the application so that organizations can deliver robust solutions as quickly as needed. Teams should be aligned to the DevOps practices for improved quality, collaboration, agility, and productivity. There is a range of tools available in the marketplace for development and operations.
- Continuous Delivery and Continuous Integration (CD & CI).
- Collaboration
- Repository Management
- Configuration Management
- Build and Deployment
- Monitoring and Logging
- Orchestration
- Continuous Testing
Architecture style:
Microservice architecture is one of the popular and effective architecture for developing and modernizing monolithic applications. It divides monolithic apps into fully functional services; these smaller services deliver all the functionalities of the monolithic app. This is an evolutionary architectural approach where each incremental step improves the architecture and keeps the system in steady-state.
There are certain advantages and trade-offs of microservice architecture, so it is significant to realize these and subsequently identify mitigation.
Advantages:
- Technology Diversity: Polyglot support in microservice provides greater flexibility to develop components. Variety of technologies, toll and APIs encourage the culture of experimentation and innovation.
- Separation of Concerns: This is the fundamental principle of microservice architecture where intended functionality is isolated into a module and exposed as a service. The rationale behind keeping service autonomous is to maintain, enhance and deploy independently.
- Autonomous Continuous Delivery: This is a major shift from traditional software delivery life cycle. Each component can be built, enhanced, deployed and tested independently without impacting the entire system.
- Leveraging Scalability and Resiliency: In the digital world, performance and ability to handle failover are crucial for any application; using microservice architecture, these can be implemented and provisioned for each service dynamically.
Trade-off:
- Cross-cutting Concerns: In monolithic application, cross-cutting concerns like partner system configuration, logs tracing, health checks, metrics, service discovery, etc. are configured centrally and are used across the application. In the case of microservice architecture, these concerns are handled per-service bases as each of them is deployed independently. This causes an overload but can be mitigated by using design patterns like chassis and external configuration.
- Operational Overhead: Moving to microservice architecture has prerequisites to have operational readiness of development and operational tools that incur the initial investment to the IT budget.
- Multiple technologies, tools, frameworks, dashboard, and API are used in developing, supporting, and monitoring the health of an application. This puts extra load on the team and therefore requires a greater emphasis on upskilling in the fast-changing technology ecosystem.
- Distributed Transaction: A microservice is designed to be autonomous and should avoid implementing distributed transactions across other services. It may affect the performance of the application and put it into an inconsistent state. Distributed transactions can be mitigated using database design patterns like the Saga pattern.
Decoupled Tactics:
- First, identify and decompose tightly coupled functional components which have frequent change requests. Convert them into independent microservices which would add value to the user by releasing the solution quickly.
- Sometimes, it is not possible to decompose some functionalities from a monolithic application due to business criticality/complexity. So, take small steps to encapsulate such functionalities and expose them as APIs from monolithic applications. Access them through anti-corruption layer (that translates communications between the two systems and avoids compromising other system) and later convert them into microservices.
- Decouple edge services which are used in user interface like user authentication, user authorization & user profile, etc.
- Monolithic application shares its centralized data across multiple functionalities. Therefore, it is important to decentralize/decouple the data so that each service can maintain its own data. Depending on the use case, multiple data storage technologies can be used. It may be open source/commercial/cloud offering like RDBMS, NoSQL, AWS Dynamo DB, Azure Cosmos DB, etc.
- Retiring and reusability of the code are two key decisions during decomposing and refactoring the application. Retire the code which is not compatible with the target framework and reuse the high-value code.
Design Pattern:
There have been good practices to follow industry-standard patterns while developing an enterprise application. In modern application development, Microservice Architecture plays a significant role but it is essential to understand some of the commonly used patterns to resolve the issues and improve the overall design. Here is a list of some good design patterns.
Frameworks and Tools:
There are a variety of technologies and tools available in the market place used in the development of microservices and addressing the technical challenges. These are also used in issues like cross-cutting concerns, performance, and security.
H1-B(i-140 Approved) | Java | springboot | Angular | AWS | Kubernetes | Terraform | Kafka
5 å¹´Thanks Arun for sharing such content... ??
Project Delivery Management | PMP | SAFe Certified | Driving Agile Transformation
5 å¹´Awesome ?? Thanks for sharing your insight
Technical Architect | Java Microservices | Spring Boot | Google Cloud Platform
5 å¹´Excellent Arun. Nice coverage of relevant matter.