Monolith Refactoring via Attributed Graph Embeddings

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Refactoring monolith applications into microservices is challenging due to difficulties in understanding domain model boundaries, ranking classes for refactoring, infusing core application artifacts for clustering, and determining metrics for clustering decisions, especially when developers lack resources or access to application runtime.

Innovation Solution

The use of attributed graph embeddings and convolutional neural networks to analyze source code, identify structural and behavioral features, generate graph structures, and automatically cluster nodes while adhering to constraints, thereby recommending candidate microservices for refactoring.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual analysis and clustering of monolith application components is performed, then developers can understand domain model boundaries and make refactoring decisions, but the process becomes time-consuming and resource-intensive

Engineering Contradiction:
Improveaccuracy of domain model boundary identificationVSAvoidrefactoring analysis time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent replaces manual mechanical analysis with automated machine learning-based graph embedding systems. The system automatically generates graph representations of the monolith application, computes node embeddings using GCN or GAT models, and performs clustering without human intervention, thereby substituting time-consuming manual efforts with automated computational processes while maintaining or improving accuracy.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system enables self-service refactoring analysis by automatically performing all necessary steps: generating application graphs from source code, computing embeddings, identifying domain model boundaries, and suggesting microservice partitions. Developers can initiate the process and receive results without requiring deep expertise in refactoring methodologies, making the system serve itself and the developers efficiently.

Inventive Principle:
Principle #25Self-service

2Manufacturing precision

If developers perform detailed source code analysis to identify structural and behavioral features, then accurate clustering decisions can be made, but the complexity of the refactoring process increases

Engineering Contradiction:
Improveclustering decision accuracyVSAvoidrefactoring process complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent segments the complex refactoring process into distinct automated modules: (1) source code parsing and graph generation, (2) node embedding computation using pre-trained GCN/GAT models, (3) constraint identification, (4) clustering execution, and (5) result visualization. Each module handles a specific aspect independently, reducing overall process complexity while maintaining high clustering accuracy through specialized processing at each stage.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system introduces graph embeddings as an intermediary representation between raw source code and final clustering decisions. Instead of directly analyzing complex source code structures, the system transforms code into graph representations, computes meaningful embeddings that capture structural and behavioral features, and then performs clustering on these embeddings. This intermediary step simplifies the overall process while preserving critical information for accurate clustering.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If automated clustering algorithms are used without constraints, then the refactoring process becomes faster, but the resulting microservices may not respect important application invariants

Engineering Contradiction:
Improverefactoring speedVSAvoidconstraint satisfaction
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary identification and encoding of constraints before executing the clustering algorithm. During graph generation and embedding computation, the system pre-identifies important application invariants such as database ownership, external service dependencies, and transaction boundaries, and encodes them as soft or hard constraints. This preliminary action ensures that constraints are considered during clustering, maintaining reliability while allowing automated fast execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms where clustering results are evaluated against identified constraints, and the process can be iteratively refined. The constraint satisfaction status is fed back into the clustering optimization, allowing the system to adjust cluster assignments to better respect application invariants. This feedback loop maintains high productivity through automation while ensuring reliability through constraint adherence.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11847443B2Constraints-based refactoring of monolith applications through attributed graph embeddings
Publication Date: 2023.12.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11847443B2 patent drawing
  • US11847443B2 patent drawing
  • US11847443B2 patent drawing

AI summary

Methods, systems, and computer program products for constraints-based refactoring of monolith applications through attributed graph embeddings are provided herein. A computer-implemented method includes performing an analysis of source code of a monolith application to identify structural features and behavioral features; generating a graph structure representing the monolith application based on the identified structural features and the identified behavioral features, wherein the graph structure comprises: a plurality of nodes, each node corresponding to one of a plurality of software modules of the monolith application, and a plurality of edges between the plurality nodes, each edge representing a relationship of the corresponding nodes; automatically identifying constraints associated with the plurality of nodes in the graph structure based on the analysis of the source code; clustering the nodes using a convolutional neural network based the constraints; and outputting candidate microservices corresponding to respective ones of the clusters for refactoring the monolith application.