A Model for Refactoring Monolithic Applications to Microservices Using Domain-Driven Design: A Case Study on IoT Irrigation Systems
Abstract
The increasing complexity of Internet of Things (IoT) applications has exposed the limitations of monolithic software architectures in addressing scalability, flexibility, and real-time processing requirements. Although microservice architectures offer a promising alternative, identifying optimal service boundaries remains a significant challenge, often resulting in excessive inter-service communication and degraded system performance when poorly defined. This study proposes a quantitative model for refactoring monolithic applications into microservices by integrating Domain-Driven Design (DDD) principles with measurable metrics, including service size, coupling, and scalability. The model systematically identifies optimal service boundaries through a structured evaluation framework. The proposed approach is validated using a case study of an IoT-based irrigation management system. Experimental results show a reduction in inter-service communication overhead and improved modularity and scalability compared to baseline decomposition approaches. The findings demonstrate that combining DDD concepts with quantitative analysis provides an effective and practical solution for guiding microservice migration in complex IoT environments. The average coupling score across the refactored system was recorded at 20.4%, which satisfies the theoretical requirement of remaining below 30% and aligns with empirical observations from successful microservice decompositions.