CARGO: AI-Guided Dependency Analysis for Migrating Monolithic Applications to Microservices Architecture
Microservices Architecture (MSA) has evolved into a de-facto standard for developing cloud-native enterprise applications during the last decade. MSA provides a variety of benefits, including quicker infrastructure deployment and service availability, elastic scalability, dependability, and increased security. To leverage these characteristics, existing (monolithic) systems must be decomposed into loosely couple microservices. This approach of decomposition, when undertaken manually, can be a rather laborious process rife with errors. As a result, there has been a surge of interest in applying AI-based technologies to identify decomposition strategies. However, the usefulness of these approaches is limited by the expressiveness of the program representation (as a result of their reliance on imprecise but extensive static analysis or exact but incomplete dynamic analysis) and their inability to model the application’s dependency on critical external resources such as databases tables. Consequently, partitioning recommendations offered by current tools result in architectures that result in (a)~distributed monoliths, and/or (b)~force the use of (often criticized) distributed transactions.
This work attempts to overcome these challenges by introducing CARGO (short for Context sensitive lAbel pRopaGatiOn)—a novel un-/semi-supervised partition refinement technique that uses a comprehensive system dependence graph built using context- and flow-sensitive static analysis of the monolithic application. CARGO offers two modes of operation: a) an unsupervised mode, where it decomposes the program with no a priori partition assignments, and ii) a semi-supervised mode, where it is seeded by the partitions discovered using any state-of-the-art microservice partitioning algorithms to refine and thereby enrich the partitioning quality of the current state-of-the-art algorithms. CARGO was used to augment four state-of-the-art microservice partitioning techniques (comprised of 1 industrial tool and 3 open-source projects). These were applied on five Java EE applications (comprised of 4 open source and 1 proprietary projects). Experimental results show that CARGO is capable of improving the partition quality of all modern microservice partitioning techniques (as measured by 4 architectural metrics). CARGO also substantially reduces distributed database transactions, which are a major bottleneck in most microservice applications. Furthermore, our real-world performance evaluation on a benchmark JEE application (Daytrader) deployed under varying loads shows that CARGO also lowers the overall the latency of the deployed microservice application by 11% and increases throughput by 120% on average, across various sequences of simulated user actions.