Today many organizations are running windows legacy .NET framework applications as they often face challenges in the legacy landscape which are inflexible, complex, high operations cost, longer time to market and workloads that are nearing end of support. Therefore, modernization of legacy systems is no longer an option and every enterprise needs to survive and succeed.
In today’s era, modern applications capabilities are expected to be Secure, Resilient, Elastic, Modular, Automated, and Interoperable. Modern applications need to stay competitive and digital business must innovate as rapidly as possible. The goal is to automate and abstract away as much as possible so our customers can focus on building modern applications for their business. To win customers, the entire focus is on decoupling the software systems and creating the business logic which can help experiment and innovate more often, drives to build better products and release features faster.
Let’s begin with a .NET monolithic application deployed on-premise where all the services are interconnected and this application is running behind a load balancer with the sticky session, since the session is stored locally on the local web server and it is backed by single monolithic database server. This application will work fine on AWS, but it will have some limitations. Those are
· Hard to Scale efficiently
· Reliability challenges
· Hard to iterate fast
· Continuous Integration/Continuous Deployment Time Consuming
Eventually this application will need to go through some sort of re architecture or refactor to maximize the investment on AWS. We will deep dive into all the possible modernization options.
Before we delve into the possible solution options for modernizing the .NET applications, let’s look at key elements of the traditional applications and desired end state of each component. Below diagram represents the mapping between the traditional services vs modern services on cloud. These are pathways to modernize. E.g. Waterfall to Agile methodology is one of the big-ticket items, is one of the key components which allows the development team to move quickly and be able to iterate, fail fast. Being from the centralized operations mindset where the operations team manages everything and thereby moving to DevOps team where individual development team responsible for the lifecycle of a modern service.
Some of the key patterns we see when we work with the customers, be it a greenfield application development or modernizing the existing applications.
1. Re platforming to Cloud Native:
Incremental modernization with automation and replacement for databases, messaging, API management, logging, monitoring, and alerting. Application can take advantage of cloud native services. Reducing the operational overhead and focus more on the applications.
2. Container Adoption:
With minimal changes to the application, leverage microservices or modular architecture to improve scalability, resource usage and lower operational overhead. We see container adoption being a common approach these days by taking the base application and break it into microservices, isolating the functionality , be able to scale better. It also helps to take advantage of even more scalability and faster development cycle.
3. Refactoring to Serverless :
Refactor to leverage serverless architectures which offer the highest efficiency and cost benefits of the cloud by pushing nearly all infrastructure and software management to the platform. Larger piece of work involved in refactoring to serverless. Taking advantage of underlying services such as Lambda or DynamoDB which are completely managed by AWS.
Modernization Option: — Replatforming:
Let’s deep dive into these patterns. In terms of modernization, the first easy step here would be replatforming the application and use more of cloud native services. Some cloud optimization is done for the application to achieve tangible benefits. For e.g. application functionality to be changed to stateless and store the session data in a distributed cache so that session need not be stored in load balancer and then wrap the front-end web servers in auto scaling group to get the benefit of elasticity in the cloud. Also, the supporting services such as logging and monitoring to more of cloud native services to get better observability of the application. Overall, the core architecture of the application is not changing when you are looking to replatform your application. In addition, on-premise database migration can be migrated to managed database service (RDS). For .NET framework applications, you can look to containerize your application to windows containers to optimize the operating system utilization and achieve runtime consistency.
Modernization Option: — Container Adoption and Refactoring to Serverless:
In this option, many customers are looking at moving from .NET framework to .NET Core on AWS to unlock the cost saving and increase productivity. Going serverless is the primary goal of decomposition as this would be the cost efficient and performant architecture where the team focus on business logic and completely sourcing out the need to take care of the infrastructure to AWS. Also refactoring and re architecture usually goes side by side when you are rewriting your code or refactoring your application or splitting your monolithic to microservices and moving business logic to microservices, at the same time we also may want to look into more of purpose-built NoSQL databases where eventual consistency is acceptable so that you can remove the more expensive, hard to scale relational databases and use the purpose built NoSQL database available in AWS. When we decompose the monolithic application to microservices, orchestrated approach with container also be a valid option. Key point to note that not all the services that are decomposed from monolithic will immediately fit into lambda and there may be right choice to go into containers and slowly when they fit better into lambda then you can migrate those to lambda and make it more event driven. In lots of cases, customers run their lambda and containers co-exists together in the production at the same time. Serverless enables you to focus on business logic by removing the heavy lifting activities performed.
Evolution of .NET Framework
.NET Framework has been in production since 2002 where this was supported in Windows NT, Windows Server 2000 operating system. Today many customers are looking at moving to open source model where anyone can contribute and collaborate. Microsoft developed .NET (previously named .NET Core) which is a free and open source framework for Windows, Linux and macOS operating systems. It is a cross-platform successor to .NET Framework.
Why AWS Cloud for hosting .NET applications?
AWS Cloud provides a strong foundation for hosting modern application with .NET 5 on AWS. .NET can be used in various target operating system like Windows, Linux, MacOS, iOS, Android, tvOS, watchOS and more. AWS support broad range of development tools to support the .NET modernization. Please refer to Figure 4 for the broad range of development tools supported on AWS.
Development Tools on AWS:
AWS provides a range of developer tools, software development kits (SDKs) and CLIs to improve the .NET developer experience.
AWS Compute Services for .NET
Let’s look at what compute choices are available to host .NET applications on AWS. We have number of choices depending on what modernizing paths you decide and what you are using. If you are targeting .NET Framework applications, then options like EC2, Elastic Beanstalk, ECS and EKS are available. For re hosting EC2 can be used. Elastic beanstalk can also be used which handles the deployment automatically, capacity provisioning etc. For Replatforming, if you are using docker containers then ECS can be used to manage containers. If you are using Kubernetes, then you can use Amazon EKS. If you are using .NET Core / .NET 5, you have the first 4 options. Additionally, you can also run your services on AWS Fargate to orchestrate those containers and you can also use AWS lambda which is serverless function technology.
Please refer to the below flowchart to decide whether applications to be Re-hosted or Re-platformed or move to Serverless.
Containerize and Migrate existing applications using AWS App2 Container:
· Streamline operations by containerizing your existing applications and standardize on a single set of tooling for monitoring, operations, and software delivery
· Analyze your applications and automatically generates a container image that is configured with the correct dependencies, network configurations, and deployment instructions for ECS / Kubernetes or App Runner.
· Easily deploy an existing application on the cloud that is provisioned with the correct networking and security configurations.
Image Credit: https://aws.amazon.com/app2container/
Porting Assistant for .NET:
· Scans your entire .NET Framework application portfolio to generate .NET Core compatibility assessment reports. This makes it easy to prioritize applications for porting based on the level of effort required.
· Identifies incompatible .NET Core APIs and packages from your .NET Framework applications, and finds known replacements reducing the manual effort of searching for replaceable packages and APIs.
Image Credit: https://aws.amazon.com/porting-assistant-dotnet/