Domain-Driven Design Representation of Monolith Candidate Decompositions Based on Entity Accesses
Miguel Levezinho, Stefan Kapferer, Olaf Zimmermann, António Rito Silva
TL;DR
The paper tackles the gap between Domain-Driven Design (DDD) and monolith-to-microservice migrations by extending the Mono2Micro pipeline with Context Mapper (CML) to produce DDD-based representations of candidate decompositions. It introduces a Structure Collector and a CML Translator that map Mono2Micro's entities, clusters, and functionalities into DDD concepts such as Entities, Bounded Contexts, Aggregates, and Coordinations (Sagas). The approach is validated on a real-world QT monolith (46 entities, 107 functionalities) showing how complexity can be reduced through functionality refactoring and how DDD-based modeling enables architects to refine decompositions within Context Mapper. The solution demonstrates modularity, practical relevance for industry adoption, and opens pathways for broader integration with DDD tooling and further refinements.
Abstract
Microservice architectures have gained popularity as one of the preferred architectural approaches to develop large-scale systems, replacing the monolith architecture approach. Similarly, strategic Domain-Driven Design (DDD) gained traction as the preferred architectural design approach for the development of microservices. However, DDD and its strategic patterns are open-ended by design, leading to a gap between the concepts of DDD and the design of microservices. This gap is especially evident in migration tools that identify microservices from monoliths, where candidate decompositions into microservices provide little in terms of DDD refactoring and visualization. This paper proposes a solution to this problem by extending the operational pipeline of a multi-strategy microservice identification tool, called Mono2Micro, with a DDD modeling tool that provides a language, called Context Mapper DSL (CML), for formalizing the most relevant DDD concepts. The extension maps the content of the candidate decompositions, which include clusters, entities, and functionalities, to CML constructs that represent DDD concepts such as Bounded Context, Aggregate, Entity, and Service, among others. The results are validated with a case study by comparing the candidate decompositions resulting from a real-world monolith application with and without CML translation.
