Previous Article in Journal
A Digital Twin Threat Survey
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Pattern-Based Framework for Automated Migration of Monolithic Applications to Microservices

by
Hossam Hassan
*,
Manal A. Abdel-Fattah
and
Wael Mohamed
Department of Information Systems, Faculty of Computers and Artificial Intelligence, Helwan University, Cairo 11795, Egypt
*
Author to whom correspondence should be addressed.
Big Data Cogn. Comput. 2025, 9(10), 253; https://doi.org/10.3390/bdcc9100253
Submission received: 24 August 2025 / Revised: 29 September 2025 / Accepted: 3 October 2025 / Published: 6 October 2025

Abstract

Over the past decade, many software enterprises have migrated from monolithic to microservice architectures to enhance scalability, maintainability, and performance. However, this transition presents significant challenges, requiring considerable development efforts, research, customization, and resource allocation over extended periods. Furthermore, the success of migration is not guaranteed, highlighting the complexities organizations face in modernizing their software systems. To address these challenges, this study introduces Mono2Micro, a comprehensive framework designed to automate the migration process while preserving structural integrity and optimizing service boundaries. The framework focuses on three core patterns: database patterns, service decomposition, and communication patterns. It leverages machine learning algorithms, including Random Forest and Louvain clustering, to analyze database query patterns along with static and dynamic database model analysis, which enables the identification of relationships between models, facilitating the systematic decomposition of microservices while ensuring efficient inter-service communication. To validate its effectiveness, Mono2Micro was applied to a student information system for faculty management, demonstrating its ability to streamline the migration process while maintaining functional integrity. The proposed framework offers a systematic and scalable solution for organizations and researchers seeking efficient migration from monolithic systems to microservices.

1. Introduction

Over the last decade, software architecture has undergone significant migration and evolution. Early software systems primarily adopted a monolithic architecture, which integrates all features into a single, cohesive structure. As the complexity and scale of the features increased, this architecture revealed significant limitations in terms of scalability, adaptability, and maintainability. To address these challenges, researchers have explored other architectures, such as service-oriented architecture (SOA), which separates software into reusable components connected through well-defined interfaces. However, SOA’s services rely on centralized control and the enterprise service bus (ESB) to work together, which may lead to performance challenges, reduced flexibility, and the creation of a single point of failure. These advancements ultimately paved the way for the emergence of microservices architecture (MSA) [1].
MSA is characterized by a collection of services, each acting autonomously to fulfill a distinct business need, which are loosely interconnected and interact through various interaction mechanisms, such as RESTful Application Programming Interfaces (APIs), asynchronous messaging queues (e.g., RabbitMQ or Kafka), or event-driven architectures utilizing event sourcing. Each microservice was independently developed, tested, released, and scaled, enabling faster releases and updates. Moreover, MSA is designed to align service boundaries with business domains. This ensures that each service encapsulates its functionality and can evolve independently without impacting the entire software system [2,3].
Owing to these advantages, MSA has gained substantial traction across the global software industry. Organizations such as Amazon, Uber, and Netflix have adopted microservices to manage their complex, large-scale, and high-traffic systems, recognizing microservices as a mature and widely adopted architectural paradigm [2,4,5].
Although the popularity of MSA continues to rise, the migration process remains a complex and time-intensive task. This journey involves major challenges related to service decomposition, inter-service communication, and database design. Moreover, the absence of a standardized methodology increases the risk of errors, leading to higher system complexity and degraded quality [4,6].
As a result, there has been growing interest in leveraging machine learning (ML) algorithms to support migration toward MSA. However, most existing studies concentrate on a single pattern, such as a decomposition pattern, with the aim of accurately breaking down a monolithic system into microservices. These studies often overlook other essential patterns, such as database patterns and communication patterns [1,7].
To support the migration from monolithic systems to microservices, this paper proposes the Mono2Micro Transformation Framework, a pattern-driven approach that facilitates systematic decomposition. The framework begins with model extraction and applies three core patterns, specifically database, decomposition, and communication patterns, to address data distribution, service identification, and inter-service communication. Each pattern leverages automated techniques such as clustering, classification, and runtime analysis to provide a comprehensive microservice extraction. The framework was applied to a real-world monolithic Student Information System (SIS) for faculty management, demonstrating its practical applicability and effectiveness.
This study addresses the following four primary research questions:
  • How can AI technologies be effectively utilized to automate the migration process?
  • What are the key challenges organizations encounter during the migration process, and how can AI-driven approaches address these challenges?
  • What criteria should be used to evaluate the effectiveness and success of AI-driven migration strategies?
  • What best practices and guidelines support the integration of AI technologies into software migration processes?
The remainder of this paper is organized as follows. Section 2 reviews work related to monolithic-to-microservices migration. Section 3 introduces the proposed Mono2Micro Framework architecture in detail. Section 4 presents an evaluation of the framework and demonstrates its application to a real-world SIS to validate its effectiveness. Section 5 discusses the experimental results and addresses the research questions posed in this study. Section 6 outlines the potential threats to validity. Finally, Section 7 concludes the paper and suggests directions for future work.

2. Related Work

This section reviews two main categories of research. The first focuses on approaches for migrating to MSA. The second explores the use of machine learning and other automated techniques to facilitate migration to MSA.

2.1. Systematic Literature Review for MSA

Velepucha et al. [8] conducted a systematic literature review (SLR), identifying challenges and benefits associated with the migration from monolithic to microservice architectures, as summarized in Table 1. Their study emphasized the importance of analyzing architectural trade-offs and advancing automation within the migration process. In a follow-up study, Velepucha et al. [9] focused on microservice decomposition strategies and proposed future directions, including the integration of micro-frontend paradigms, the development of automated decomposition techniques, and extending evaluation beyond object-oriented architectures.
Francisco et al. [10] analyzed 20 studies on MSA migrations and found that most approaches, targeting web-based systems, rely on design artifacts, dependency graphs, and clustering algorithms. However, the study was limited by the use of a single search engine and potential researcher bias. The authors emphasized the need for broader investigations, including deeper analysis of migration approaches and database transition strategies.
Authors in [11,12,13] conducted an SLR revealing that microservice decomposition remains an emerging field, with limited methodologies for effectively integrating static, dynamic, and evolutionary data. They further identified the lack of robust tool support as a significant barrier and emphasized the need for additional research on deployment strategies as well as the establishment of standardized evaluation metrics for microservice migration.
Other studies have highlighted the challenges related to service identification [14,15,16,17]. These works emphasize the need for improved automation techniques and standardized evaluation metrics. While various service identification algorithms have been proposed, many focus on specific aspects of the migration process, often overlooking other critical patterns. Furthermore, comprehensive solutions that support the full migration pipeline remain limited. Some studies also suggest organizing services by category to improve reusability at scale and facilitate real-world applicability.
Recent studies have investigated migration in both directions between monolithic and MSA. Su et al. [18] found that organizations reverted to monolithic systems due to concerns related to cost, complexity, performance, scalability, and organizational difficulties. In contrast, Razzaq et al. [19] highlighted the benefits of MSA adoption, such as independent deployment, scalability, and efficient communication. Both studies underscore the need for further empirical research and practical solutions to facilitate the migration process.

2.2. Tools and Techniques for MSA

Recent studies present a wide range of approaches for automating the identification of microservices during migration from monolithic systems. Many studies propose the use of clustering methods based on business processes, use cases, UML models, and runtime relationships to extract the boundaries of microservices [20,21,22]. While these approaches have demonstrated improved performance in specific scenarios, they share a common limitation: a lack of generalizability and standardized evaluation metrics. Their methodologies are often tailored to specific domains, and they provide limited support for adapting to heterogeneous systems or evolving architectural quality requirements.
In parallel, Desai et al. [23] and Santos et al. [6] focused on metric-based assessments to evaluate the quality and complexity of microservice decompositions. Desai et al. proposed a graph neural network model, the Clustering and Outlier-aware Graph Convolution Network (COGCN), which combines clustering and outlier detection. They evaluated it using structural modularity and interface-based metrics. Santos et al. introduced a complexity metric that integrates access sequences, read/write operations, and relaxed transactional consistency. Although these studies present robust evaluation frameworks, they do not integrate comprehensive migration pipelines and lack generalizability. Additionally, Ma et al. [24] adopted Microservices Identification using Analysis for Database Access (MIADA), which emphasizes “database per service” clustering to facilitate the identification of microservices. While their approach demonstrated promising results in two service-oriented systems, MIADA remains specialized and lacks broader applicability.
On the other hand, numerous studies have explored various strategies to support the migration to MSA, focusing on performance, modularization, and architectural decision-making. Authors in [6,25] demonstrated that modular monolithic architectures can ease migration and improve scalability; however, the reliance on individual case studies limits generalizability. Additionally, authors in [26,27] conducted performance comparisons, showing that while monolithic architectures perform better on single machines and are suitable for small- to medium-scale systems, microservices scale more efficiently in distributed environments. Furthermore, authors in [28,29] introduced tools for code transformation and performance modeling, although both require broader validation and integration with automation tools. Finally, authors in [30,31] addressed modularization and stakeholder challenges but did not sufficiently assess architectural complexity in large-scale systems.
The literature emphasizes a critical need for generalizable, automated, and multi-dimensional frameworks that incorporate architectural quality, runtime behavior, and system context. There is also a notable gap in comprehensive tool support, empirical benchmarking, and real-world validation across diverse platforms. Table 2 presents the categories and thematic summary of the reviewed studies. To contextualize the contributions of the proposed Mono2Micro framework, Table 3 presents a structured comparison of recent monolith-to-microservices migration approaches. The comparison outlines the degree to which each paper addresses database pattern support, service decomposition, inter-service communication, integration of machine learning techniques, evaluation methodologies, and applicability to real-world systems.
As illustrated in Table 3, only one prior work [6] addresses all three architectural dimensions. However, it lacks the incorporation of AI techniques and does not provide a comprehensive multi-metric evaluation. The majority of reviewed studies focus primarily on service decomposition, omitting others. Specifically, only 1 out of 13 studies covers all three dimensions, while nearly half focus on a single architectural pattern. While these works address isolated aspects of the migration process, the proposed Mono2Micro framework is the first to systematically integrate all three core patterns into a unified, AI-driven migration pipeline. The proposed approach delivers end-to-end migration support by combining supervised and unsupervised learning methods, validated on a real-world system, and demonstrates effectiveness through quantitative metrics across all transformation phases, as detailed in Section 4.

3. Research Methodology

This section introduces the Mono2Micro Transformation Framework, a comprehensive pattern-driven methodology designed to facilitate the migration of monolithic systems to MSA. The framework addresses key aspects of the transformation process, including data decomposition, service identification, and inter-service communication, through a sequence of structured steps.
As illustrated in Figure 1, the framework consists of three core architectural patterns: database, decomposition, and communication. These are preceded by a model extraction phase and followed by a validation and refinement stage. The proposed Mono2Micro framework is distinctive in that it simultaneously addresses all three architectural dimensions, rather than focusing on a single aspect, as seen in most existing studies.

3.1. Database Patterns

The Database Patterns component of the Mono2Micro framework addresses one of the most critical challenges in MSA: organizing and managing data in a distributed environment. In monolithic systems, data is typically centralized and accessed directly [32]. However, in MSA, each service is expected to manage its own data independently—a principle commonly referred to as “Database per Service.” Ensuring consistency, performance, and logical separation of data becomes a non-trivial task during migration.
In this approach, both static and dynamic database interactions within the SIS system were analyzed to recommend the most appropriate database architecture pattern for each entity. Additionally, a prediction model was developed using machine learning algorithms to support and validate these recommendations. The process consists of the following steps:

3.1.1. Extract Query Pattern

Following the extraction phase, in which all relevant database entities from the SIS were identified, runtime behavior was monitored to capture query patterns, including read, write, and join operations. These patterns were then used as input for subsequent processing steps.

3.1.2. Dynamic Analysis of Runtime Behavior

Dynamic analysis was performed to monitor the behavior of database entities at runtime and to gain deeper insights into data access patterns within the SIS system. The analysis focused on three primary query types: read, write, and join operations. For each operation type, a robust statistical approach was employed to determine representative thresholds. Specifically, the median was used to mitigate the effect of outliers and capture the central tendency in skewed query distributions [20,21,22,26]. In cases where the median equaled zero—a situation common in sparse operations—the mean was applied as a fallback to avoid degenerate thresholds and ensure consistent classification. This design choice balances robustness and inclusiveness, providing stable thresholds across varying workloads. Since thresholds are computed over normalized ratios rather than absolute counts, the method is inherently scalable and generalizable to systems of different sizes, workloads, and query distributions, while remaining adaptable to domain-specific tuning.
Entities were categorized based on their query frequency relative to the computed thresholds, as shown in Table 4. An entity was labeled as read-heavy, write-heavy, or join-heavy if the count of its corresponding operation exceeded the relevant median value. This classification provided the foundation for subsequent analysis, particularly in recommending appropriate database patterns for each entity.

3.1.3. Data Preparation

In this step, a set of rule-based classification heuristics was defined to map entities to suitable database architectural patterns based on their observed runtime query behavior. The classification logic was constructed around the six most common database architecture patterns, formed by combinations of the three behavioral indicators: read-heavy, write-heavy, and join-heavy.
  • Command Query Responsibility Segregation (CQRS): separates read and write operations into distinct models, enhancing performance and scalability. It is well-suited for read-heavy and join-heavy workloads.
  • Event Sourcing: records all changes to application state as a series of immutable events. This pattern is optimal for systems characterized by write-heavy activity and complex data relationships (join-heavy).
  • Independent Database: this pattern is suitable for scenarios in which data access or modification is infrequent. This pattern allows complete decoupling from other services.
  • Read Replicas: uses replicated databases to enhance read performance. It is ideal for entities with read-heavy and minimal join operations.
  • Sharding: distributes data across multiple databases based on a shard key. This pattern is advantageous for write-heavy workloads with low join frequency.
  • Database per Service: assigns each service its own database. This pattern is suitable for join-heavy interactions within a single bounded context where read and write frequencies are relatively low.
The raw query metrics—read, write, and join counts—were normalized using Min-Max Scaling to bring all values into a common range between 0 and 1. This normalization ensured consistent feature weighting and mitigated bias caused by differing value scales.
Following this preprocessing step, the recommended database architectural patterns were initially stored as categorical labels, which are incompatible with most ML algorithms. To address this, the labels were transformed into numerical form using a label encoding technique, where each unique pattern was assigned a distinct integer value. This structured dataset was used to train and evaluate the ML model in the next step.

3.1.4. Apply Classification Algorithm

Random Forest (RF), a supervised ML algorithm, was employed to assess how well the prepared dataset could predict suitable database architectural patterns. The model was trained on normalized read, write, and join operation counts to predict architectural pattern labels that were systematically generated through our rule-based labeling strategy (detailed in Section 3.1.2 and Section 3.1.3). For example, entities with a read ratio above the global median were labeled as read-heavy, while those dominated by write or join operations were labeled accordingly. The dataset was split into 60% training and 40% testing, and features (read, write, join counts) were normalized using Min-Max scaling. The RF classifier was configured with standard hyperparameters (100 trees, Gini impurity, fixed random seed) to balance performance and reproducibility.
The RF classifier was chosen for its robustness and ability to model non-linear boundaries. After training, it predicted architectural patterns on the test set, which we compared against the ground truth to assess performance.

3.1.5. Provide Pattern Recommendations for Services

After the classification model was trained and evaluated, it was applied to predict architectural patterns for each database entity in the SIS system. Each entity, represented by its normalized read, write, and join metrics, was assigned a recommended architectural pattern based on the model’s output. These predictions were interpreted as pattern recommendations to guide how each entity should be treated during microservice decomposition.

3.1.6. Visualize the Results

This step yields summary distributions of access behavior (read, write, join) and the resulting architectural pattern allocations; the corresponding plots and quantitative analysis are presented in Section 5.2.

3.2. Service Decomposition

The second phase of the Mono2Micro framework focuses on decomposing the system’s structure by analyzing the relationships among entities to identify potential microservices [33]. The objective of this stage is to uncover cohesive groups of entities that serve as candidates for independently deployable services. A graph-based clustering approach is employed to model and quantify the strength of inter-entity relationships. To improve the accuracy of decomposition and better reflect actual system behavior, the structural graph is enriched with runtime controller-to-entity mappings. This hybrid representation captures both static dependencies and dynamic usage patterns, thereby enabling data-driven partitioning of the monolithic system into functionally coherent service boundaries [34]. The decomposition process consists of the following six steps:

3.2.1. Build Relationship Matrix

Following the extraction phase, each model within the SIS system was identified, along with its associated relationships. The extracted structure includes entities and their relational types, such as has_one, has_many, belongs_to, and belongs_to_many, which collectively form the foundation of the relationship matrix. In this matrix, each entity is represented as a node in a graph, and the relationships are encoded as weighted edges based on their type and relative importance. In addition, the model is extended with controller-to-entity mappings derived from service-layer analysis to reflect real-world usage. A co-access matrix was constructed based on entity co-occurrence within services, capturing functional relationships not evident in static code. This hybrid matrix forms the basis for building a graph that incorporates both architectural and behavioral dimensions of the system.
This matrix shows how SIS models depend on each other and serves as the basis for constructing a weighted undirected graph for the clustering process in subsequent phases.

3.2.2. Preprocess Data

In this step, the hybrid graph was prepared for clustering by applying a custom weighting scheme that accounts for both structural cohesion and functional behavior.
Structural edges were assigned weights according to relationship type, reflecting their relative semantic strength, as follows: belongs_to (1.0), belongs_to_many (0.75), has_many (0.5), and has_one (0.25). Although these weights were assigned empirically, the ordering follows established concepts in software coupling metrics, such as coupling between objects and other concepts established by ORM conventions (e.g., Laravel Eloquent, Hibernate), where ownership relations represent stronger coupling than aggregation or references. To assess the robustness of this choice, a sensitivity analysis was conducted by varying the assigned weights by ±25% and ±50%. The results showed stable clustering structures with only minor metric fluctuations, confirming that the method is not sensitive to moderate changes in weight assignment.
Concurrently, behavioral edges were derived from runtime co-access frequencies, to ensure comparability with structural edges and to mitigate the influence of extreme outliers; these raw co-access frequencies (f) were normalized using a logarithmic transformation followed by percentile-based scaling. It is formally defined as:
1,0   n o r m s ,     ( min max l o g ( 1 +    f ) P 10 ,   0 ,   P 90   P 10 ) / ( P 90   P 10 )
where P 10 and P 90   denote the 10th and 90th percentiles of all non-zero co-access values, respectively. This scaling bounds all values between 0 and 1, mitigates the effect of extreme outliers, and preserves the relative ranking of interaction strengths. Following a mild quadratic transformation, f i n a l s =   ( n o r m s ) 1.2 was applied to further emphasize stronger behavioral connections while reducing the influence of weaker ones.
Then, Edges from both sources were adaptively merged through weighted averaging. It is defined as:
( r u n t i m e w × 0.5 ) + ( s t a t i c w × 0.5 ) = c o m b i n e d w
This equal weighting was selected after preliminary experiments demonstrated that it consistently produced higher modularity and silhouette scores than alternative ratios (e.g., 0.6–0.4, 0.7–0.3). To prevent spurious links, new runtime-only edges were added selectively: only when both nodes belonged to the same preliminary Louvain cluster and exceeded a minimum normalized strength. These optimizations preserved the design-time semantics of the structural model while incorporating runtime behavior in a controlled manner. The result is a fully connected, undirected, weighted graph that reflects both structural cohesion and functional interaction and serves as input to the clustering algorithm in the next step.

3.2.3. Apply Clustering

After the preprocessing step, a graph-based clustering algorithm was applied to decompose the SIS into structurally cohesive groups. The Louvain community detection algorithm was selected for its efficiency in optimizing modularity and identifying well-defined communities in large entity relationship graphs, constructed from the SIS system’s structural and behavioral data. As the Louvain algorithm is unsupervised, it does not involve a training phase in the conventional sense. Instead, it operates directly on a weighted undirected graph, optimizing modularity to detect cohesive communities, which are interpreted as candidate microservices.
Each node in the graph represents a model entity from the SIS system, and each edge corresponds to a defined entity’s relationship, such as belongs_to, has_many, has_one, or belongs_to_many, or a runtime co-access behavioral pattern. These relationships are assigned numeric weights based on their semantic strength and frequency, following a custom weighting scheme. If an entity pair shares multiple relationships, the weights are aggregated accordingly. The resulting graph structure encodes the architectural relationships between entities and is used as input for the Louvain algorithm.
The algorithm operates by iteratively maximizing modularity Q, as defined in (7), to enhance intra-cluster edge density while minimizing inter-cluster connections. As a result, entities with strong relationships are grouped into clusters that represent potential microservice boundaries. Each resulting cluster consists of tightly coupled models and serves as a candidate for an independently deployable service.

3.2.4. Determine Optimal Cluster

Following the clustering process, a validation step is performed to evaluate the coherence and separation of the resulting clusters. Although the Louvain algorithm inherently maximizes modularity, additional analysis is necessary to confirm that the resulting groups correspond to meaningful microservice boundaries. The structural quality of the clusters is assessed using established evaluation metrics, and the results are presented and discussed in Section 4.

3.2.5. Assign to Microservices

Once optimal clusters are identified, each cluster is interpreted as a candidate microservice. Entities grouped within the same cluster are assumed to exhibit strong structural cohesion and are therefore assigned to a common service boundary. This assignment reflects the principle of high internal cohesion and low external coupling, which is fundamental to microservice-oriented design. Each cluster encapsulates related functionalities, forming the basis for independently deployable and maintainable services within the system architecture.

3.2.6. Visualize Clustering

This step yields a weighted graph of entities and community assignments (Louvain). The corresponding visualization and observations are presented in Section 5.3.

3.3. Communication Patterns

The third phase of the Mono2Micro framework focuses on analyzing the communication behavior between clustered SIS entities to recommend suitable interaction protocols [35]. This phase evaluates how services should exchange data based on aggregated access ratios, join frequencies, and operation intensity. By examining both static relationships and dynamic runtime behavior, the framework aims to assign communication strategies—such as REST APIs, GraphQL, or asynchronous messaging—that align with scalability, responsiveness, and architectural best practices.
These communication strategy recommendations are based on normalized read, write, and join ratios, computed per cluster using query log data. Thresholds are derived from global averages across all entities. Clusters with read or join activity above these thresholds are classified as having frequent interaction, where synchronous protocols such as GraphQL or gRPC are recommended. Clusters with lower interaction intensity are considered loosely coupled and better suited for asynchronous messaging solutions like RabbitMQ or Kafka. These mappings are applied over the same clusters defined in the earlier decomposition phase and serve as experience-driven, data-informed heuristics. These strategies are presented as heuristic guidance rather than strict rules and will be refined through future expert validation.
The communication pattern process is structured into the following key steps:

3.3.1. Aggregate Cluster-Level Access Metrics

To characterize service-level communication behavior, access metrics are aggregated across all entities within each identified cluster. Specifically, the average read, write, and join ratios are calculated by first computing the access ratios for each entity—based on the proportion of each access type to total operations—and then averaging these values across the cluster. This aggregation provides a representative summary of communication behavior for each service, minimizes the influence of outliers, and supports consistent comparisons across clusters.

3.3.2. Establish Global Communication Threshold

Global thresholds are defined to provide a consistent baseline for classifying communication patterns. These thresholds are determined by averaging the normalized read, write, and join ratios across all the entities within the SIS. The resulting values serve as benchmarks to assess whether a cluster exhibits relatively high or low access characteristics. This thresholding mechanism ensures that communication decisions are grounded in system-wide statistical behavior rather than arbitrary values.

3.3.3. Assign Communication Pattern

The global thresholds for read, write, and join ratios were calculated as 0.933, 0.803, and 1.216, respectively, representing the mean normalized values across all entities. For each cluster, the average read, write, and join ratios were computed and compared against these thresholds to guide protocol selection. Clusters with a join ratio above the global join threshold and a read ratio above the global read threshold were assigned GraphQL, as it supports flexible, multi-entity queries. When the join ratio was high, but the read ratio remained below the global average, gRPC was selected for its efficiency in high-volume data exchange. Clusters with a write ratio above the global write threshold (without a high join ratio) were mapped to transactional REST APIs, while those with a high read ratio (without high join or write ratios) were assigned REST APIs with caching. All remaining clusters defaulted to asynchronous messaging solutions (e.g., Kafka, RabbitMQ). This mapping aligns communication styles with workload profiles and architectural goals.

3.3.4. Visualize Communication Classifications

This step generates a three-dimensional scatter plot representing each cluster’s communication profile, with axes corresponding to average read, write, and join ratios. Clusters are color-coded according to their assigned communication pattern. The corresponding visualization and interpretation are reported in Section 5.4.

4. Experiment Evaluation

This section presents the evaluation strategy applied to the three transformation patterns proposed by the Mono2Micro framework. Each pattern was assessed using validation criteria tailored to its specific objectives. Standard evaluation metrics—such as accuracy, precision, recall, F1 score, classification report, confusion matrix, modularity, conductance, and silhouette score—were used to provide a comprehensive and reliable assessment, as detailed in the subsections.

4.1. Database Pattern Evaluation

The database pattern recommendations were evaluated by comparing the predictions of the RF classifier against the heuristic-based labels assigned during preprocessing. Evaluation metrics included accuracy, precision, recall, F1 score, and a confusion matrix. These measures assess the classifier’s ability to correctly identify database architectural patterns. Results indicated strong predictive performance and reliable pattern identification. The model’s accuracy was computed by evaluating its predictions on the test subset comprising 40% of the labeled data. Accuracy was defined as the ratio of correct predictions to the total number of test samples. In addition, weighted precision, recall, and F1-score were calculated to assess the model’s ability to correctly classify each architectural pattern. A confusion matrix was also generated to analyze misclassification trends. All evaluation metrics were computed using the Scikit-learn Python library version 1.5.1.

4.1.1. Accuracy

Accuracy is a fundamental metric for evaluating model performance [36]. It measures the proportion of correctly classified instances out of the total number of instances. In this context, accuracy quantifies how often the database pattern classifier produces the correct prediction. It is formally defined as:
A C C = ( T P + T N ) / ( T P + T N + F P + F N )  
where TP denotes true positives, TN true negatives, FP false positives, and FN false negatives.

4.1.2. Precision

Precision is a critical metric for evaluating Mono2Micro models, especially in cases where false positives carry a high cost. It measures the proportion of correctly predicted positive observations to the total predicted positive observations [36], reflecting the model’s ability to avoid misclassifying negative samples as positive. A high precision score indicates a low false positive rate. It is defined as:
P = T P / ( T P + F P )  

4.1.3. Recall

Recall, also known as sensitivity or true positive rate (TPR), measures the model’s effectiveness in identifying all relevant positive cases. Mono2Micro uses recall to evaluate how well the classifier captures all relevant database patterns [36]. It is defined as:
R T P R = T P / ( T P + F N )  

4.1.4. F1-Score

The F1 score is the harmonic mean of precision and recall, offering a single measure that balances both concerns. It is especially important in contexts where both false positives and false negatives must be minimized [36]. A high score indicates that the model achieves both high precision and recall. It is defined as:
F 1   S C O R E = 2 × (   P r e c i s i o n   ×   R e c a l l / ( P r e c i s i o n + R e c a l l ) )  
To assess the contribution of each input feature, an ablation study was conducted by independently removing read, write, and join operation metrics from the classifier input. As shown in Figure 2, excluding the read feature caused the largest performance degradation, reducing the F1-score by approximately 60%. Removing join operations resulted in an 18.7% decrease, while excluding write operations had a negligible impact. These results confirm the significance of both read and join metrics in predicting appropriate database architectural patterns.

4.1.5. Confusion Matrix

The confusion matrix summarizes classification performance by presenting a comparison between the actual and predicted labels. It presents the number of true positives, true negatives, false positives, and false negatives in a tabular format, offering insights into class-specific errors.

4.2. Decomposition Pattern Evaluation

The second pattern evaluation focuses on assessing the quality of the Mono2Micro decomposition step. Several clustering validation metrics were used to measure the effectiveness of the resulting partitions. Specifically, modularity was used to quantify the strength of the division into communities, conductance was applied to evaluate inter-cluster separation, and the silhouette score was calculated to assess cluster cohesion and separation. To better reflect functional behavior, the decomposition graph was augmented with controller-to-entity mappings, capturing dynamic interactions in addition to static dependencies.
As the Louvain algorithm is unsupervised, its performance was not evaluated using classification accuracy. Instead, these structural metrics were used as standard measures for validating graph-based clustering outcomes, offering insight into the cohesion and separation of the identified service clusters. These metrics collectively provide a comprehensive evaluation of the decomposition quality.

4.2.1. Modularity

Modularity measures the density of edges within clusters compared to the density between clusters. A higher modularity value indicates stronger community structures with dense internal connections and sparse external ones [22,37]. Modularity is defined as:
Q = ( 1 / 2 M )   i , j A i , j ( k i   k j / 2 m )     δ   c i   c j
where A i , j is the weight of the edge between nodes i   a n d   j , k i and k j are the sum of weights of edges attached to nodes i   a n d   j , m is the total weight of all edges in the graph, and δ c i c j is 1 if i   a n d   j are in the same community and 0 otherwise.

4.2.2. Conductance

Conductance measures the fraction of edge volume that points outside a cluster relative to the total volume of the cluster. Lower conductance values indicate better-isolated clusters, meaning fewer external connections relative to internal ones [38]. Conductance is defined as:
ϕ S = c u t   S ,       S ¯ / min v o l S ,     v o l S ¯
where c u t S , S ¯ is the sum of weights of edges connecting S to the rest of the graph S ¯ , and v o l S is the sum of degrees of all nodes in S .

4.2.3. Silhouette Score

The silhouette score measures how well an entity fits within its assigned cluster relative to others. It considers cohesion within clusters and separation between clusters. The silhouette score metric is formally defined as:
s i = b i     a i / ( max a i ,     b i )
where a i is the average distance between i and all other points in the same cluster, and b i is the lowest average distance between i and all points in any other cluster.

4.3. Communication Pattern Evaluation

In the third pattern, the evaluation focuses on validating the correctness of the communication pattern classification among clustered SIS models. Each cluster’s communication behavior was analyzed based on three aggregated metrics: average read ratio, average write ratio, and average join ratio. Communication patterns were assigned based on threshold comparisons derived from the global dataset statistics. These thresholds guided the assignment of patterns such as REST API with Caching, GraphQL (Read-Optimized), gRPC (High Data Exchange), Transactional REST API, or Asynchronous Messaging.
Since the focus in this pattern is on the clustering of services rather than individual entities, traditional quantitative metrics such as accuracy or F1-score were not applied. Instead, a 3D scatter plot visualization was employed to qualitatively assess the separation and accuracy of the communication patterns across service clusters based on their aggregated operational characteristics. The evaluation relied on the following:
  • Average Read Ratio: Measures the proportion of read operations relative to total operations inside each cluster.
  • Average Write Ratio: Measures the proportion of write operations relative to total operations inside each cluster.
  • Average Join Ratio: Measures the frequency of join operations relative to total operations inside each cluster.
Clusters were then visualized in a 3D plot, where each axis represents one of the three metrics, and each cluster was color-coded based on the assigned communication pattern, as will be discussed in detail in Section 5.4.

5. Results and Discussion

This section presents the experimental results obtained by applying the Mono2Micro framework to the SIS system. The outcomes for each transformation pattern—database architecture, service decomposition, and communication—are illustrated and analyzed. The results are interpreted using the evaluation metrics introduced earlier, offering insights into the framework’s effectiveness, limitations, and practical implications.

5.1. Experimental Setup

The experimental evaluation was conducted on a real-world SIS system, which serves as the core platform for managing student records, course registrations, academic scheduling, and administrative processes. The SIS application comprises over 40 interconnected entities, offering a realistic and sufficiently complex case study for analyzing service decomposition and architectural modernization. Its diverse access patterns, rich entity relationships, and high volume of transactional operations made it a suitable environment for evaluating the Mono2Micro framework across database design, microservice decomposition, and communication strategy patterns.
To support the evaluation, the chosen SIS system was originally developed using the Laravel framework, with MySQL serving as the underlying database management system. The dataset used for experimentation was extracted through a combination of static and dynamic analysis. Static structural information was obtained by parsing the ORM (Eloquent) relationships defined in the Laravel models, while dynamic access patterns were recorded by analyzing real-time SQL query logs captured during production usage.
This comprehensive extraction approach provided a reliable foundation for evaluating the Mono2Micro framework’s predictions across database design, service decomposition, and communication patterns. The following subsections summarize the key results and discuss their implications.

5.2. Database Pattern Results

Initially, a bar chart was constructed to illustrate the distribution of recommended architectural patterns across all database entities, as shown in Figure 3. This overview highlights how variations in read, write, and join behaviors influence the assignment of architectural patterns such as CQRS, event sourcing, sharding, and others. In addition to the bar chart, a stacked bar chart was created to represent the composition of access heaviness, read, write, and join for each entity, as shown in Figure 4. Each bar corresponds to a distinct entity and is segmented according to the presence of specific access behaviors. This visualization demonstrates how various combinations of access operations influence the classification outcomes and the resulting architectural pattern recommendations.
Subsequently, the database pattern classification yielded strong results. The RF classifier demonstrated reliable predictive performance across key evaluation metrics. Specifically, the model achieved an accuracy of 86%, a precision of 91.7%, a recall of 86%, and an F1-score of 85.8%. These results indicate that the system effectively classified entities into their appropriate database architectural patterns.
Although the initial architectural labels were generated using rule-based heuristics, the integration of the RF classifier provided enhanced generalization capabilities. Unlike fixed-threshold rules, the classifier learns soft decision boundaries and captures complex, non-linear interactions among input features. Although the classification dataset is deterministic and not drawn from a probabilistic distribution, a Repeated Stratified K-Fold Cross-Validation (5 folds, 10 repetitions) was conducted to assess the statistical reliability of the model’s performance across multiple data splits. This evaluation procedure resulted in a mean weighted F1-score of 0.8578, accompanied by a 95% confidence interval of [0.8181, 0.8975], indicating the model’s robustness and stable predictive capability across diverse partitions.
Furthermore, the ablation study presented in Figure 2 demonstrates the critical role of read and join features in accurate pattern classification. This machine learning-based approach also improves scalability, as new architectural patterns can be incorporated through retraining without modifying existing rules.
The confusion matrix and pattern distribution in Figure 5 demonstrate that the model accurately assigned entities to their respective architectures, with Independent Database and CQRS emerging as dominant patterns. This outcome aligns with the SIS system’s operational characteristics, which emphasize independent data management and read-intensive workloads—typical of systems preparing for migration of microservices.

5.3. Decomposition Pattern Results

To enhance interpretability, the final clusters are visualized as a weighted graph, as shown in Figure 6. Each node represents an SIS entity, and edges indicate the relationships between them, scaled by their assigned weights. Clusters are color-coded based on community assignments, while node sizes are proportional to their degree of connectivity. This visual representation provides a clear overview of the SIS’s structural decomposition and highlights how tightly coupled components are grouped. Such visualization supports stakeholders’ understanding of the proposed microservice boundaries and aids in validating the decomposition results.
Subsequently, the decomposition pattern evaluation employed modularity, conductance, and silhouette coefficient metrics. To enrich the analysis and improve decomposition accuracy, the structural graph was augmented with runtime controller-to-entity access data, enabling the graph to reflect both static relationships and dynamic usage patterns. This hybridization enhanced the relevance of the clusters from a functional perspective.
A modularity score of 0.529 was achieved, indicating strong internal density within clusters relative to the overall network structure. This value exceeds the typical range (0.1–0.25) reported in recent studies on microservice decomposition [23], reflecting the effectiveness of the proposed clustering in producing coherent service boundaries. Furthermore, the silhouette score was 0.6448, which lies within the moderate-to-high range considered acceptable given the complexity of real-world systems and the inclusion of runtime behavior. While the silhouette metric is rarely reported in existing microservice decomposition studies, it is included here as part of a more comprehensive and interpretable evaluation framework.
Additionally, conductance values, illustrated in Figure 7, ranged from 0.14 to 0.30, demonstrating that the clusters maintained low external connectivity and acceptable cohesion. Overall, these results affirm the effectiveness of the decomposition phase in generating meaningful service boundaries suitable for migration of microservices.
To assess the effect of incorporating runtime controller-entity mappings, we compared the original static-only clustering with a hybrid model that blends structural and behavioral interactions. Table 5 summarizes the results across four evaluation dimensions. This comparison highlights the improvement in cohesion Strength—measured as the sum of intra-cluster edge weights, representing the total internal relationship strength within each cluster—and functional separation achieved through the integration of runtime controller-to-entity access patterns. While modularity increased only slightly, the silhouette score improved considerably, indicating more coherent and well-separated clusters. In addition, average conductance decreased, reflecting fewer inter-cluster connections and stronger boundaries between services.
In addition, to ensure a fair and rigorous evaluation, the proposed framework was re-executed on the same open-source projects utilized by MIADA, with particular emphasis on the largest and most complex dataset, Spring-Boot-Blog-REST-API. A reliable ground truth was established through manual decompositions provided by five independent domain experts, and the consensus was employed for validation. The results show that our framework consistently achieved higher Adjusted Rand Index (ARI) values compared to MIADA’s reported best score of 0.893, thereby demonstrating superior clustering accuracy. Furthermore, the direct comparison was extended to include internal quality measures that were not addressed in MIADA, namely average conductance (0.32), an average silhouette score of 0.6481, and a modularity score of 0.341, as shown in Table 6. These metrics confirm that the generated clusters exhibit both strong cohesion and clear separation. In addition, our Mono2Micro framework was validated on a Java/Spring Boot project, thereby demonstrating its applicability across heterogeneous technology stacks beyond SIS/Laravel. These results show that the suggested method is more robust and generalizable than MIADA when applied to diverse and complex systems.

5.4. Communication Pattern Results

To facilitate interpretation and validation, a three-dimensional scatter plot is constructed to represent each cluster’s communication profile, as shown in Figure 8. The axes correspond to average read ratio, write ratio, and join ratio, with clusters color-coded according to their assigned communication pattern. This visualization provides an intuitive overview of behavioral clustering and illustrates the correlation between access intensity and communication strategy. Such graphical analysis enhances transparency and supports the validation of the classification logic.
The communication behavior among the clustered services was evaluated using aggregated access metrics, including average read, write, and join ratios. Based on the calculated thresholds, services were classified into appropriate interaction strategies such as GraphQL (read-optimized), gRPC (high data exchange), REST API with caching, and asynchronous messaging. The classification results were visualized using a 3D scatter plot, shown in Figure 8, which revealed clear separation among service groups according to their operational characteristics. This visualization supports the validity of the communication pattern assignments and highlights how access behavior drives the selection of inter-service communication strategies.
In addition to the threshold-based classification, performance simulations were conducted to evaluate latency and throughput across the proposed communication protocols, thereby reinforcing the validity of the communication interaction patterns. Baseline latency and throughput values were derived from prior benchmarking studies [6,25,35] and scaled according to each cluster’s workload profile (read, write, or join-heavy). To ensure that the simulation captured the comparative strengths of the protocols, scaling adjustments were applied to emphasize the well-documented advantages of caching in REST-based systems, the efficiency of GraphQL in join-intensive queries, and the superior throughput characteristics of gRPC in data-intensive workloads. These adjustments were informed by empirical trends reported in the literature rather than fixed rules, and their selection was guided by the need to balance interpretability with realism. Sensitivity analysis further confirmed that moderate variation by ±25% in these adjustments did not alter the overall protocol assignment, thereby supporting the robustness of the simulation.
Figure 9 presents the performance results, which demonstrate that REST API + Caching achieves the lowest latency in read-heavy clusters, GraphQL improves performance in join-heavy scenarios, gRPC provides the highest throughput under data-intensive workloads, and the Transactional REST API remains stable in write dominated contexts. These results extend the threshold-based classification with empirical simulation evidence and support the effectiveness of the selected inter-service communication strategies.

5.5. Summary of Findings

This study employed a combination of machine learning, graph-based clustering, and runtime behavior analysis techniques to support the Mono2Micro migration framework. Specifically, Random Forest classification was applied for database architectural pattern identification, Louvain community detection was used for service decomposition based on both entity relationships and dynamic controller-to-entity mappings, and a threshold-based approach was employed to assign appropriate communication patterns across clustered services. These integrated steps are summarized in Algorithm 1.
The evaluation results demonstrated the effectiveness of the proposed approach across all migration phases. High classification accuracy was achieved for database patterns, strong modularity and conductance scores were observed in service decomposition, and the communication patterns were consistently assigned based on empirical operational characteristics. These outcomes confirm that the framework can effectively automate critical aspects of monolithic system migration preparation. In addition, the comparison with existing tools, such as MIADA [24], confirmed that our framework consistently outperformed MIADA’s reported best ARI and further demonstrated robustness through additional quality measures (Conductance, Silhouette, Modularity). Unlike MIADA and Mono2Micro, which remain restricted to specific environments, our approach proved to be more generalizable and effective across heterogeneous systems. It should also be noted that the ablation study in Section 4 is limited to the supervised classification stage (database patterns), as decomposition and communication phases are based on unsupervised clustering and heuristic mapping, for which feature-level ablation is not directly applicable. Their robustness was instead assessed using structural quality metrics, such as modularity and conductance, which reflect the cohesion and separation of the resulting service clusters.
Algorithm 1 Mono2Micro Framework Classification Process
Input:
-
Static Metadata (Entity Models and Relationships).
-
Runtime Query Statistics (Read, Write, Join Counts)
Output:
-
Database Architectural Patterns.
-
Service Clusters.
-
Communication Patterns
Steps:
1: Database Pattern Detection:
1.1
Load entity runtime query statistics.
1.2
Determine read-heavy, write-heavy, and join-heavy flags using median thresholds.
1.3
Apply rule-based classification.
1.4
Normalize features using Min-Max scaling.
1.5
Train the RF classifier for database prediction.
1.6
Evaluate model performance and visualize the results.
2: Service Decomposition:
2.1
Load static entity-relationship metadata and runtime controller-to-entity mappings.
2.2
Construct a hybrid undirected weighted graph.
2.3
Apply the Louvain community detection algorithm to identify service clusters.
2.4
Evaluate the model and visualize the results.
3: Communication Pattern Classification:
  • Aggregate runtime metrics per cluster.
  • Compare against global thresholds.
  • Assign communication strategies (REST, gRPC, GraphQL, Messaging).
  • Visualize cluster communication behavior
The research questions guiding this work were addressed as follows:
RQ1: How can AI technologies be effectively utilized to automate the migration process?
The proposed Mono2Micro framework successfully employed AI techniques, specifically the Random Forest classifier and graph-based clustering (Louvain algorithm), to automate the key phases of database pattern identification, service decomposition, and communication pattern assignment. Both the Random Forest model and the Louvain community detection algorithm demonstrated strong performance during evaluation, contributing to accurate and efficient migration outcomes. This approach significantly minimized manual engineering effort and validated the practical applicability of AI in streamlining the migration process.
RQ2: What are the key challenges organizations encountered during the migration process, and how can AI-driven approaches address these challenges?
The Mono2Micro framework addressed major migration challenges, including extracting static metadata from ORM models and capturing dynamic runtime behavior through SQL query logs without disrupting the production environment, and accurately grouped entities into services while addressing hidden couplings and runtime variability. By combining empirical data analysis with machine learning and graph clustering techniques, the framework enabled a scalable and automated migration process.
RQ3: What are the criteria for evaluating the effectiveness and success of AI-driven migration strategies?
The effectiveness of the Mono2Micro-based migration process was validated through a comprehensive set of quantitative metrics. These included accuracy, precision, recall, F1 score, modularity, conductance values, and silhouette coefficients that were employed to rigorously evaluate the classification, decomposition, and communication pattern stages, ensuring the robustness and reliability of the framework.
RQ4: What best practices and guidelines support the integration of AI technologies into software migration processes?
The findings emphasize that combining static metadata analysis with dynamic runtime behavior is essential for building effective AI-driven migration strategies. The Mono2Micro framework demonstrated that static structures alone are insufficient; instead, incorporating real-world system behavior leads to more accurate service boundaries and communication pattern assignments. This integrated approach serves as a best practice for organizations aiming to adopt AI-assisted software modernization, ensuring more reliable, scalable, and context-aware migration outcomes.

6. Threats to Validity

This section examines the validity of the study by analyzing potential internal, external, and construct-related threats, following established evaluation guidelines [39].
Internal validity reflects efforts made to ensure accurate and unbiased results by using real-world production data for both static metadata and dynamic runtime behavior extraction. However, the framework remains sensitive to the quality of SQL logs: any incompleteness, sampling bias, or limited observation period in these logs may result in distorted ratios of read, write, and join operations, which in turn can affect the accuracy of database and communication pattern assignments. To mitigate the risk of biased or incomplete SQL logs, query statistics were collected over operational periods and complemented with static ORM metadata. Furthermore, runtime co-access frequencies were normalized using logarithmic transformation and percentile-based scaling, ensuring that outliers were controlled while preserving the relative ranking of interactions. This normalization reduced the dependency on raw query distributions and improved the robustness of the results across varying workloads. In addition, the manual assignment of relationship weights for structural edges may introduce bias. To address this, we applied sensitivity analysis by varying weights ±25% and ±50%, which confirmed stable clustering with only minor metric fluctuations. Future work will explore automated weight learning and optimization to further reduce dependence on manual rules.
External validity relates to the generalizability of the findings beyond the specific case examined. The proposed Mono2Micro framework was validated on a real-world SIS system developed using Laravel and MySQL and further evaluated on the open-source Java/Spring Boot dataset used in the MIADA study. These experiments confirmed that the framework is applicable across heterogeneous technology stacks, rather than being limited to a single environment. In addition, because the proposed Mono2Micro framework operates at the level of entities and SQL query logs, it can be extended beyond monolithic systems to different architectural styles, such as client-server and service-oriented architectures. While the current evaluation focused on monolith-to-microservices migration, the underlying principles are not restricted to this context, and future work will investigate the additional complexities of applying the framework in more distributed settings.
Ablation analysis was limited to the supervised learning component for database pattern classification, where input features (read, write, join) could be isolated and evaluated using the F1-score. The decomposition component, based on unsupervised Louvain clustering over a structural relationship graph, does not involve labeled outputs, making traditional ablation inapplicable. As part of future work, we plan to extend the framework to support additional patterns and broaden comparisons with other state-of-the-art tools.
Finally, the construct validity ensures that the study accurately measures the intended concepts and objectives. In this study, established metrics such as accuracy, precision, recall, modularity, conductance, and silhouette scores were used to rigorously validate the results of each Mono2Micro phase. The framework’s evaluation approach was aligned with the research questions, reinforcing the validity of the constructs being assessed.

7. Conclusions and Future Work

This study introduced the Mono2Micro framework as a comprehensive, AI-driven solution for facilitating the migration from monolithic architectures to microservices. By integrating machine learning classification, graph-based community detection, and runtime behavior analysis, the framework successfully automated the critical phases of the migration process. It specifically addressed three key dimensions: database architectural pattern identification, service decomposition, and communication strategy assignment. The evaluation results demonstrated that combining static metadata with dynamic execution traces can yield high-accuracy models, coherent service clusters, and context-aware communication protocols, thus enhancing both the precision and practicality of microservice migration.
The Mono2Micro Framework was rigorously evaluated using diverse metrics, including classification accuracy, modularity, conductance, and silhouette scores. Each migration phase was assessed independently, providing a multi-perspective validation of the framework’s effectiveness and robustness. The experimental application on a real-world SIS system further underscored the practicality and generalizability of the approach.
The novelty of the proposed Mono2Micro framework lies in its tri-pattern foundation, which is not addressed in combination by any prior work. By applying supervised and unsupervised learning techniques across structural and behavioral layers of the system, Mono2Micro offers a differentiated and comprehensive approach to automated microservices migration.
Future studies will focus on enhancing the scalability and adaptability of the proposed Mono2Micro framework, including the exploration of advanced learning techniques, such as deep learning, for capturing nuanced behavioral patterns, extending the framework to accommodate a broader range of communication protocols, and empirically validating protocol recommendations. Moreover, the framework will be tested on larger-scale enterprise systems to assess its robustness and generalizability across diverse industrial domains. Ultimately, the Mono2Micro framework aims to evolve into an industrial-grade tool, offering practical support for researchers and software engineers in automating and optimizing the migration process from monolithic to microservice architectures.

Author Contributions

Conceptualization, H.H., M.A.A.-F. and W.M.; methodology, H.H. and M.A.A.-F.; software, H.H.; validation, M.A.A.-F. and W.M.; formal analysis, H.H.; investigation, H.H. and W.M.; resources, M.A.A.-F.; data curation, H.H.; writing—original draft preparation, H.H.; writing—review and editing, M.A.A.-F. and W.M.; visualization, H.H.; supervision, M.A.A.-F. and W.M.; project administration, M.A.A.-F.; funding acquisition, not applicable. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are openly available in [IEEE-Dataport] at [10.21227/45k9-ag47].

Acknowledgments

The authors would like to thank all the anonymous reviewers for their insightful comments and constructive suggestions that have obviously improved the quality of this manuscript.

Conflicts of Interest

The authors declare that they have no known competing financial interest or personal circumstances that could have appeared to influence the work reported in this manuscript.

Abbreviations

The following abbreviations are used in this manuscript:
SOAService-Oriented Architecture.
ESBEnterprise Service Bus.
MSAMicroservices architecture.
APIsAbstract programming interface.
MLMachine learning.
SISStudent Information System.
SLRSystematic literature review.
COGCNClustering and Outlier-aware Graph Convolution Network.
MIADAMicroservices Identification using Analysis for Database Access.
ARI Adjusted Rand Index.
CQRSCommand Query Responsibility Segregation.
RFRandom forest.
fRaw co-access frequencies.
ACCAccuracy.
TPTrue Positive.
TNTrue Negative.
FPFalse Positive.
FNFalse Negative.
R(TPR)Sensitivity or True Positive rate.
gRPC High-performance, open-source Remote Procedure Call.
ORM Object-Relational Mapping
JEEJava Enterprise Edition
ARIAdjusted Rand Index

References

  1. Hassan, H.; Abdel-Fattah, M.A.; Mohamed, W. Migrating from Monolithic to Microservice Architectures: A Systematic Literature Review. Int. J. Adv. Comput. Sci. Appl. 2024, 15, 104–116. [Google Scholar] [CrossRef]
  2. Newman, S. Building Microservices: Designing Fine-Grained Systems, 2nd ed.; O’Reilly Media: Sebastopol, CA, USA, 2021; ISBN 978-1492034018. [Google Scholar]
  3. de Almeida, M.G.; Canedo, E.D. Authentication and Authorization in Microservices Architecture: A Systematic Literature Review. Appl. Sci. 2022, 12, 3023. [Google Scholar] [CrossRef]
  4. Sellami, K.; Ouni, A.; Saied, M.A.; Bouktif, S.; Mkaouer, M.W. Improving microservices extraction using evolutionary search. Inf. Softw. Technol. 2022, 151, 106996. [Google Scholar] [CrossRef]
  5. Ponce, F.; Soldani, J.; Astudillo, H.; Brogi, A. Smells and Refactorings for Microservices Security: A Multivocal Literature Review. J. Syst. Softw. 2022, 192, 111393. [Google Scholar] [CrossRef]
  6. Mazzara, M.; Dragoni, N.; Bucchiarone, A.; Giaretta, A.; Larsen, S.T.; Dustdar, S. Microservices: Migration of a Mission Critical System. IEEE Trans. Serv. Comput. 2021, 14, 1464–1477. [Google Scholar] [CrossRef]
  7. Assuncao, W.K.G.; Colanzi, T.E.; Carvalho, L.; Pereira, J.A.; Garcia, A.; de Lima, M.J.; Lucena, C. Multi-Criteria Strategy for Redesigning Legacy Features as Microservices: An Industrial Case Study. In Proceedings of the 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2021, Honolulu, HI, USA, 9–12 March 2021; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2021; pp. 377–387. [Google Scholar]
  8. Velepucha, V.; Flores, P. Monoliths to microservices—Migration Problems and Challenges: A SMS. In Proceedings of the 2021 2nd International Conference on Information Systems and Software Technologies, ICI2ST 2021, Quito, Ecuador, 23–25 March 2021; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2021; pp. 135–142. [Google Scholar]
  9. Velepucha, V.; Flores, P. A Survey on Microservices Architecture: Principles, Patterns and Migration Challenges. IEEE Access 2023, 11, 88339–88358. [Google Scholar] [CrossRef]
  10. Ponce, F.; Marquez, G.; Astudillo, H. Migrating from monolithic architecture to microservices: A Rapid Review. In Proceedings of the 2019 38th International Conference of the Chilean Computer Science Society (SCCC), Concepcion, Chile, 4–9 November 2019. [Google Scholar] [CrossRef]
  11. Abgaz, Y.; McCarren, A.; Elger, P.; Solan, D.; Lapuz, N.; Bivol, M.; Jackson, G.; Yilmaz, M.; Buckley, J.; Clarke, P. Decomposition of Monolith Applications Into Microservices Architectures: A Systematic Review. IEEE Trans. Softw. Eng. 2023, 49, 4213–4242. [Google Scholar] [CrossRef]
  12. Fritzsch, J.; Bogner, J.; Zimmermann, A.; Wagner, S. From Monolith to Microservices: A Classification of Refactoring Approaches. arXiv 2018, arXiv:1807.10059. [Google Scholar]
  13. Ghofrani, J.; Lübke, D. Challenges of Microservices Architecture: A Survey on the State of the Practice. 2018. Available online: http://ceur-ws.org/Vol-2072 (accessed on 1 May 2018).
  14. Oumoussa, I.; Saidi, R. Evolution of Microservices Identification in Monolith Decomposition: A Systematic Review. IEEE Access 2024, 12, 23389–23405. [Google Scholar] [CrossRef]
  15. Abdellatif, M.; Shatnawi, A.; Mili, H.; Moha, N.; El Boussaidi, G.; Hecht, G.; Privat, J.; Guéhéneuc, Y.-G. A taxonomy of service identification approaches for legacy software systems modernization. J. Syst. Softw. 2021, 173, 110868. [Google Scholar] [CrossRef]
  16. Justas, K.; Dalius, M. Migrating Legacy Software to Microservices Architecture; Institute of Electrical and Electronics Engineers: Vilnius, Lithuania, 2019; p. 32. [Google Scholar]
  17. Kalske, M.; Mäkitalo, N.; Mikkonen, T. Challenges When Moving from Monolith to Microservice Architecture. In Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics); Springer: Berlin/Heidelberg, Germany, 2018; pp. 32–47. [Google Scholar]
  18. Su, R.; Li, X.; Taibi, D. From Microservice to Monolith: A Multivocal Literature Review. Electronics 2024, 13, 1452. [Google Scholar] [CrossRef]
  19. Razzaq, A.; Ghayyur, S.A.K. A systematic mapping study: The new age of software architecture from monolithic to microservice architecture—Awareness and challenges. Comput. Appl. Eng. Educ. 2023, 31, 421–451. [Google Scholar] [CrossRef]
  20. Daoud, M.; El Mezouari, A.; Faci, N.; Benslimane, D.; Maamar, Z.; El Fazziki, A. A multi-model based microservices identification approach. J. Syst. Arch. 2021, 118, 102200. [Google Scholar] [CrossRef]
  21. Li, J.; Xu, H.; Xu, X.; Wang, Z. A Novel Method for Identifying Microservices by Considering Quality Expectations and Deployment Constraints. Int. J. Softw. Eng. Knowl. Eng. 2022, 32, 417–437. [Google Scholar] [CrossRef]
  22. Kalia, A.K.; Xiao, J.; Krishna, R.; Sinha, S.; Vukovic, M.; Banerjee, D. Mono2Micro: A practical and effective tool for decomposing monolithic Java applications to microservices. In ESEC/FSE 2021—Proceedings of the 29th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering; Association for Computing Machinery, Inc.: New York, NY, USA, 2021; pp. 1214–1224. [Google Scholar]
  23. Desai, U.; Bandyopadhyay, S.; Tamilselvam, S. Graph Neural Network to Dilute Outliers for Refactoring Monolith Application. Proc. AAAI Conf. Artif. Intell. 2021, 35, 72–80. [Google Scholar] [CrossRef]
  24. Ma, S.-P.; Lu, T.-W.; Li, C.-C. Migrating Monoliths to Microservices based on the Analysis of Database Access Requests. In Proceedings of the 16th IEEE International Conference on Service-Oriented System Engineering, SOSE 2022, San Francisco, CA, USA, 15–18 August 2022; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2022; pp. 11–18. [Google Scholar]
  25. Faustino, D.; Gonçalves, N.; Portela, M.; Silva, A.R. Stepwise migration of a monolith to a microservice architecture: Performance and migration effort evaluation. Perform. Eval. 2024, 164, 102411. [Google Scholar] [CrossRef]
  26. Blinowski, G.; Ojdowska, A.; Przybylek, A. Monolithic vs. Microservice Architecture: A Performance and Scalability Evaluation. IEEE Access 2022, 10, 20357–20374. [Google Scholar] [CrossRef]
  27. Bjørndal, N.; de Araújo, L.J.P.; Bucchiarone, A.; Dragoni, N.; Mazzara, M.; Dustdar, S. Migration from Monolith to Microservices: Benchmarking a Case Study. J. Object Technol. 2020, 3, 1. [Google Scholar] [CrossRef]
  28. Fuertes, A.B.; Pérez, M.; Meza, J. Transpiler-Based Architecture Design Model for Back-End Layers in Software Development. Appl. Sci. 2023, 13, 11371. [Google Scholar] [CrossRef]
  29. Tapia, F.; Mora, M.Á.; Fuertes, W.; Aules, H.; Flores, E.; Toulkeridis, T. From monolithic systems to microservices: A comparative study of performance. Appl. Sci. 2020, 10, 5797. [Google Scholar] [CrossRef]
  30. Prasandy, T.; Titan; Murad, D.F.; Darwis, T. Migrating Application from Monolith to Microservices. In Proceedings of the 2020 International Conference on Information Management and Technology (ICIMTech), Bandung, Indonesia, 13–14 August 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 726–731. [Google Scholar]
  31. Vainio, M.; Antti-Pekka, T. The Benefits and Challenges in Migrating from a Monolithic Architecture into Microservice Architecture. 2021. Available online: http://www.cs.helsinki.fi/ (accessed on 21 February 2021).
  32. Li, S.; Zhang, H.; Jia, Z.; Li, Z.; Zhang, C.; Li, J.; Gao, Q.; Ge, J.; Shan, Z. A dataflow-driven approach to identifying microservices from monolithic applications. J. Syst. Softw. 2019, 157, 110380. [Google Scholar] [CrossRef]
  33. Jin, W.; Liu, T.; Zheng, Q.; Cui, D.; Cai, Y. Functionality-Oriented Microservice Extraction Based on Execution Trace Clustering. In Proceedings of the 2018 IEEE International Conference on Web Services, ICWS—Part of the 2018 IEEE World Congress on Services, San Francisco, CA, USA, 2–7 July 2018; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2018; pp. 211–218. [Google Scholar]
  34. Ren, Z.; Wang, W.; Wu, G.; Gao, C.; Chen, W.; Wei, J.; Huang, T. Migrating web applications from monolithic structure to microservices architecture. In Proceedings of the ACM International Conference Proceeding Series, Tokyo, Japan, 25–28 November 2018; Association for Computing Machinery: New York, NY, USA, 2018. [Google Scholar] [CrossRef]
  35. Kholy, M.E.; Fatatry, A.E. Framework for Interaction between Databases and Microservice Architecture. IT Prof. 2019, 21, 57–63. [Google Scholar] [CrossRef]
  36. Hossin, M.; Sulaiman, M.N. A Review on Evaluation Metrics for Data Classification Evaluations. Int. J. Data Min. Knowl. Manag. Process 2015, 5, 01–11. [Google Scholar]
  37. Jin, W.; Liu, T.; Cai, Y.; Kazman, R.; Mo, R.; Zheng, Q. Service Candidate Identification from Monolithic Systems Based on Execution Traces. IEEE Trans. Softw. Eng. 2019, 47, 987–1007. [Google Scholar] [CrossRef]
  38. Lin, L.; Li, R.; Jia, T. Scalable and Effective Conductance-Based Graph Clustering. Proc. AAAI Conf. Artif. Intell. 2023, 37, 4471–4478. [Google Scholar] [CrossRef]
  39. Runeson, P.; Höst, M. Guidelines for conducting and reporting case study research in software engineering. Empir. Softw. Eng. 2009, 14, 131–164. [Google Scholar] [CrossRef]
Figure 1. The proposed Mono2Micro Transformation Framework.
Figure 1. The proposed Mono2Micro Transformation Framework.
Bdcc 09 00253 g001
Figure 2. F1-scores under feature ablation for database pattern classification.
Figure 2. F1-scores under feature ablation for database pattern classification.
Bdcc 09 00253 g002
Figure 3. Distribution of Predicted Architecture Patterns across Database Entities.
Figure 3. Distribution of Predicted Architecture Patterns across Database Entities.
Bdcc 09 00253 g003
Figure 4. Stacked bar chart showing the composition of access heaviness (read, write, join) for each entity.
Figure 4. Stacked bar chart showing the composition of access heaviness (read, write, join) for each entity.
Bdcc 09 00253 g004
Figure 5. Confusion matrix for predicted database architectural patterns.
Figure 5. Confusion matrix for predicted database architectural patterns.
Bdcc 09 00253 g005
Figure 6. Structural clustering of SIS entities based on entities’ relationships. Nodes represent entities; edges represent weighted relationships.
Figure 6. Structural clustering of SIS entities based on entities’ relationships. Nodes represent entities; edges represent weighted relationships.
Bdcc 09 00253 g006
Figure 7. Conductance values for SIS service clusters.
Figure 7. Conductance values for SIS service clusters.
Bdcc 09 00253 g007
Figure 8. Three-dimensional view of service clusters based on access behavior and assigned communication pattern.
Figure 8. Three-dimensional view of service clusters based on access behavior and assigned communication pattern.
Bdcc 09 00253 g008
Figure 9. Simulated latency and throughput of communication patterns across service clusters. Bar charts show absolute values, while line charts highlight relative trends, confirming the effectiveness of the assigned protocols.
Figure 9. Simulated latency and throughput of communication patterns across service clusters. Bar charts show absolute values, while line charts highlight relative trends, confirming the effectiveness of the assigned protocols.
Bdcc 09 00253 g009
Table 1. Challenges during the software migration process.
Table 1. Challenges during the software migration process.
Challenges
Selecting appropriate tools to support the MSA migration process.
Performing full-scale migration without decomposition.
Reorganizing stakeholders and teams during MSA adoption.
Difficulties in identifying and designing service boundaries
Migrating all components regardless of suitability.
Ensuring data consistency during database transitions
Integrating modern technologies into monolithic applications.
Selecting appropriate tools to support the MSA migration process.
Table 2. Summary of Research Categories in MSA Migration.
Table 2. Summary of Research Categories in MSA Migration.
Study FocusKey ContributionsCommon Limitations
Systematic ReviewsIdentified MSA migration
challenges and benefits.
Insufficient tool support
and generalizability
Automation TechniquesClustering, graph-based methods, and
database identification.
Domain-specific approaches,
limited scalability.
Case StudiesEvaluations of performance
and modular architectures
Case-specific findings,
inadequate architectural complexity.
Table 3. Comparison of Recent Monolith-to-Microservices Migration Approaches.
Table 3. Comparison of Recent Monolith-to-Microservices Migration Approaches.
StudyYearDB
Pattern
DecompositionCommunicationML/AIEvaluation MetricsReal-World System
[6]2021Availability, fault tolerance.
[20]2021Coupling and Relational Cohesion.
[21]2022Coupling, cohesion, performance.
[22]2021Coupling, cohesion (custom metrics).
[23]2021Modularity, Structural Modularity.
[24]2022ARI (Adjusted Rand Index).
[25]2024Latency, throughput, scalability.
[26] 2022Response Time, CPU, Latency.
[27]2021Latency, throughput, CPU, and network usage.
[28]2023Performance, scalability, reliability, and conducting comparisons.
[29]2020Response Time, Error Rate, and Throughput.
[30]2020Qualitative: Modularity, Maintainability.
[31]2021
This Work2025Accuracy, Precision, Recall, F1, Modularity, Conductance, Silhouette Score.
Table 4. Sample of Runtime Query Pattern Statistics for SIS Entities.
Table 4. Sample of Runtime Query Pattern Statistics for SIS Entities.
Entity NameRead
Ops
Write
Ops
Join
Ops
Is
Read-Heavy
Is
Write-Heavy
Is
Join-Heavy
Users392 K2 K3 KTRUETRUETRUE
Course220 K03.4 KTRUEFALSETRUE
Students241 K236 K3.5 KTRUETRUETRUE
Days33 K06.3 KTRUEFALSETRUE
Places2 K06.3 KFALSEFALSETRUE
Timetable15 K1 K0.2 KTRUETRUEFALSE
Table 5. Comparison Of Static Vs. Hybrid Service Decomposition Models.
Table 5. Comparison Of Static Vs. Hybrid Service Decomposition Models.
Evaluation MetricHybrid ModelStatic-Only Model
Cohesion Strength4241
Modularity0.5290.523
Silhouette Score0.64480.5843
Average Conductance0.240.26
Table 6. Direct Performance Comparison Between MIADA and the Proposed Framework.
Table 6. Direct Performance Comparison Between MIADA and the Proposed Framework.
DatasetMetricMIADAProposed Framework
Blog APIARI0.890.96
Blog APISilhouette0.6481
Blog APIModularity0.341
Blog APIConductance0.32
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hassan, H.; Abdel-Fattah, M.A.; Mohamed, W. A Pattern-Based Framework for Automated Migration of Monolithic Applications to Microservices. Big Data Cogn. Comput. 2025, 9, 253. https://doi.org/10.3390/bdcc9100253

AMA Style

Hassan H, Abdel-Fattah MA, Mohamed W. A Pattern-Based Framework for Automated Migration of Monolithic Applications to Microservices. Big Data and Cognitive Computing. 2025; 9(10):253. https://doi.org/10.3390/bdcc9100253

Chicago/Turabian Style

Hassan, Hossam, Manal A. Abdel-Fattah, and Wael Mohamed. 2025. "A Pattern-Based Framework for Automated Migration of Monolithic Applications to Microservices" Big Data and Cognitive Computing 9, no. 10: 253. https://doi.org/10.3390/bdcc9100253

APA Style

Hassan, H., Abdel-Fattah, M. A., & Mohamed, W. (2025). A Pattern-Based Framework for Automated Migration of Monolithic Applications to Microservices. Big Data and Cognitive Computing, 9(10), 253. https://doi.org/10.3390/bdcc9100253

Article Metrics

Back to TopTop