Learning Library

← Back to Library

AI-Driven Legacy Application Modernization

Key Points

  • Maja Vuković introduces Project Minerva for Modernization, which leverages AI and machine learning to automate the refactoring of legacy enterprise applications into microservices.
  • Building on the large, multilingual code dataset from Project CodeNet, Minerva addresses common pitfalls of traditional refactoring such as tightly‑coupled classes, distributed monoliths, and broken distributed transactions.
  • The approach combines advanced program analysis with AI‑driven partitioning to improve the quality and independence of generated microservices, enabling safer, more manageable migration paths.
  • A practical example shows how naive call‑flow analysis might incorrectly split classes A, B, and C into separate services, while Minerva detects hidden shared state (e.g., common SQL handlers) that would require tighter coupling or redesign.
  • By automating these insights, Minerva reduces the need for extensive manual rewrites, allowing teams to modernize legacy three‑tier systems more reliably and efficiently.

Full Transcript

# AI-Driven Legacy Application Modernization **Source:** [https://www.youtube.com/watch?v=2fszvFC-O2I](https://www.youtube.com/watch?v=2fszvFC-O2I) **Duration:** 00:05:51 ## Summary - Maja Vuković introduces Project Minerva for Modernization, which leverages AI and machine learning to automate the refactoring of legacy enterprise applications into microservices. - Building on the large, multilingual code dataset from Project CodeNet, Minerva addresses common pitfalls of traditional refactoring such as tightly‑coupled classes, distributed monoliths, and broken distributed transactions. - The approach combines advanced program analysis with AI‑driven partitioning to improve the quality and independence of generated microservices, enabling safer, more manageable migration paths. - A practical example shows how naive call‑flow analysis might incorrectly split classes A, B, and C into separate services, while Minerva detects hidden shared state (e.g., common SQL handlers) that would require tighter coupling or redesign. - By automating these insights, Minerva reduces the need for extensive manual rewrites, allowing teams to modernize legacy three‑tier systems more reliably and efficiently. ## Sections - [00:00:00](https://www.youtube.com/watch?v=2fszvFC-O2I&t=0s) **Untitled Section** - - [00:03:18](https://www.youtube.com/watch?v=2fszvFC-O2I&t=198s) **Cargo Algorithm Optimizes Microservice Partitioning** - The speaker explains that while a naïve split would place ticket classes A, B, and C into separate services, the Cargo algorithm from Project Minerva detects tight coupling between A and B, recommends bundling them into one microservice and isolating C, thereby improving partition quality, reducing latency, and boosting throughput in complex airline systems. ## Full Transcript
0:00How do you modernize legacy enterprise applications without breaking anything? 0:05Moving to microservices-based architectures may be easier than you think, or at least easier than it was a few years ago. 0:12My name is Maja Vuković and today I will share with you how to use AI to automate application refactoring. 0:19In 2021, we have launched Project CodeNet, 0:23a dataset consisting of over 14 million code samples derived from half a billion lines of code in over 55 languages. 0:32As the community of developers, engineers and researchers grew, there were new additions to the Project CodeNet. 0:40One such advancement is Project Minerva for Modernization. 0:53Project Minerva for Modernization tackles the challenges in automated application refactoring. 0:58So let's take a look. 0:59Typically, enterprise legacy systems have followed a three-tier application architecture, 1:08starting with the top layer being UI, followed by business logic, which talks and interacts with one or more databases. 1:17Within the business logic layer, there are multiple programs and classes 1:21talking and depending on each other, and some of them may no longer be used. 1:26Most of the traditional approaches to application refactoring aim to derive the more microservices architecture. 1:34What does that mean, is that the business logic gets partitioned into multiple microservices, 1:39each of which is meant to be more individual-- stand on its own --so that you can easier detect faults. 1:45It's easier to have individual teams looking after them and it's more easier to manage them once deployed. 1:51Each of them also talks to a separate database. 1:55However, with existing algorithms, what sometimes might happen is that the classes that form these microservices, 2:04they actually might be more tightly coupled, which results in a distributed monolith, 2:08or requires additional rewrite to handle and orchestrate these dependencies. 2:13Similar problems might arise from distributed transactions that get essentially broken as part of the modernization journey. 2:22So with Project Minerva for Modernization, we tackle these challenges. 2:27How does this work in practice? 2:29We bring together innovation from program analysis, 2:32coupled with advances in AI and machine learning to improve the partition quality of microservices. 2:38We all know the complexities of the airline travel and booking the trips. 2:46Let's step step back and look how typically an application would work. 2:51Let's zoom into a couple of classes, such as classes A, B, and C. 2:56Class A is order, Class B is buy ticket action, which calls and relies on the config ticket class. 3:13Now, most of the algorithm, we just observe the call flows between the classes. 3:18It would recommend that order ticket A could be made for microservice one 3:24and that B and C are bundled together in microservice two. 3:29However, as you dig deeper, there's actually a dependency and tight coupling between the two classes. 3:36In the within the heap, they share a couple of objects, such as SQL handler and ticket order. 3:47Moreover, they both write to the same database. 3:53So with the following recommendation, you would actually have to do some work 3:57to remediate that high coupling between--the tight coupling between classes A and B. 4:02And this is where the algorithm Cargo steps in, which is part of the Project Minerva for Modernization. 4:10It actually observes the code and data entanglement and resolves-- remediates --distributed actions. 4:16So based on these observations, Cargo would actually recommend 4:19the classes A and B form one microservice and Class C is separated in another. 4:25It essentially improves the quality of the partition. 4:28Now it might look too simple--there are three classes. 4:31But we all know the complexities of the airline systems. 4:34You have multiple databases, points, users, flights and so on. 4:39You have thousands-- tens of thousands --of classes and multiple interactions. 4:44So you really need a lot of effort to carve out ideal partitions. 4:49We have applied Cargo algorithm on a number of sample applications.And in addition to remediating 4:56distributed transactions, it also helps lower the latency and increase the throughput. 5:14Moreover, it also improves the quality of the partitions. 5:17What it means, it reduces the coupling and increases the cohesion of microservice partitions. 5:23Cargo need not only be applied to the modernization scenarios. 5:27In fact, Cargo can also help you analyze net-new developed microservices and improve their quality. 5:34With this, I would like to invite you to join Project Minerva for Modernization, 5:39as we soon are going to be launching challenges. 5:44Please join us on this mission on improving and advancing the state of the art in application of refactoring. 5:50Thank you.