Modernizing legacy monolithic applications from on-prem to the public cloud is a challenging task.
Those applications may have produced value for organizations for many years, but the challenge of upgrading components (such as hardware), outdated versions of programming languages (such as Java, .NET, etc.), lack of proper resiliency, and more, makes the ongoing maintenance a nightmare.
Assuming our organization decides to put effort into application and workload modernization, to take full benefit of modern or cloud-native applications, how do we leverage GenAI capabilities for application modernization?
In this blog post I will share my experience with AI code assistances for application modernization.
What are the benefits of application/workload modernization?
There are many benefits of modernizing legacy applications, to name a few:
- Use of latest software components – The ability to replace outdated or unsupported versions of software components with versions supporting new capabilities (fewer security vulnerabilities, better performance, new APIs, better compatibility with modern applications, etc.)
- Efficiency – The ability to replace hardware (from new instance type, latest block storage, etc.), and gain the best performance (and in many cases, even better pricing than previous generations), with minimum effort and very small downtime.
- Scalability – The ability to re-architect existing workloads to meet business requirements for high availability (add or remove resources to meet customers' demand).
- Observability – The ability to collect logging and telemetry based on API calls from all resources in the cloud to a central cloud-native aggregation and correlation solution.
- Modern architecture – The ability to re-architect existing workload and be able to use cloud-native capabilities such as microservices, event-driven architectures, containers, or functions-as-a-service, instead of physical or virtual machines (that do not scale very well).
- Use of managed services – The ability to consume services such as storage, database, GenAI, etc., and focus on developing new offerings for customers, instead of ongoing service maintenance.
We can see that there are many benefits of application modernization, but how do we deal with outdated programming language versions?
Using Amazon Q Developer (Code transformation) for Java application modernization
In the example below, I have used the Amazon Q developer add-on as part of Visual Studio Code, using Claude Sonnet 4, to review a sample Java 8 application (source: https://github.com/aws-samples/qct-sample-java-8-app), assess the application, and create an upgrade to Java 17.
First, I used Amazon Q Code to create documentation of the Java application (using the /doc command):
Final result:
Then, I used Amazon Q Code to upgrade the Java application code version 17 (using the /transform command):
And the final result (before and after the proposed changes):
For more information about Amazon Q Developer and its capabilities for upgrading Java projects, see:
- Transforming Java applications with Amazon Q Developer
- Modernize your Java application with Amazon Q Developer
Using Amazon Q Developer (Code transformation) for .NET application modernization
In the example below, I have used the Amazon Q developer add-on as part of Visual Studio Code, using Claude Sonnet 4, to upgrade a sample .NET 4.8 application (source: https://github.com/aws-samples/sample-amazon-q-transform-dotnet-4.8-webapi), to .NET 8:
Below is a summary of the upgrade process:
Then, I have asked Amazon Q Code to run a build for the upgraded application:
Finally, I have asked Amazon Q Code to run a test to validate the upgrade, and below are the results:
For more information about Amazon Q Developer and its capabilities for upgrading .NET applications, see:
Summary and some personal thoughts
While evaluating Amazon Q Developer, I was able to accomplish an upgrade of a Java application, an upgrade of a .NET application (from version 4.8 to version 8), and an upgrade of a Python application (from version 3.7 to version 3.10).
Important disclaimer – I am not a developer, and if I were able to use Amazon Q developer to upgrade different applications, a task that I have no doubt is challenging for most developers, taking legacy code and struggling with the upgrade process, I see Amazon Q developer application modernization capabilities as very promising.
I also tried GitHub Copilot app modernization for .NET and GitHub Copilot app modernization for Java, but was unable to complete an upgrade process without getting multiple errors, and the build process always failed.
I tried GitHub Copilot for the upgrade process with the same Java, .NET, and Python applications that I used with the Amazon Q developer, but was unable to complete the task.
For using the GitHub Copilot app for modernization Java, I was required to upgrade my license to GitHub Copilot Pro, but even after enabling 30-day trial license, logging off, and logging back in, the extension refused to perform an upgrade of a Java application.
I tried to switch between GPT-4.1, GPT-4o, and Clause Sonnet 3.5, but it did not change the result.
I finally tried Google Gemini Code Assist, with the mentioned applications, but in most cases, Gemini Code Assist provided me with manual recommendations, or it was unable to provide a complete automated resolution for the upgrade process.
As a last result, I used Amazon Q developer on applications that both GitHub Copilot and Gemini Code Assist failed to complete an upgrade and build process, and Amazon Q developer was able to resolve all errors and complete the build task.
I am sure all tools will mature over time and will enable developers to focus on building new applications and modernizing legacy applications, but at least at the time of writing this blog post, I believe Amazon Q developer is the most mature solution from all three cloud providers.
About the author
Eyal Estrin is a seasoned cloud and information security architect, AWS Community Builder, and author of Cloud Security Handbook and Security for Cloud Native Applications. With over 25 years of experience in the IT industry, he brings deep expertise to his work.
Connect with Eyal on social media: https://linktr.ee/eyalestrin.
The opinions expressed here are his own and do not reflect those of his employer.
Top comments (0)