ON THE MIGRATION OF DOMAIN DRIVEN DESIGN TO CQRS WITH EVENT SOURCING SOFTWARE ARCHITECTURE

Authors

DOI:

https://doi.org/10.32782/IT/2024-1-7

Keywords:

Domain-Driven Design, CQRS, Event Sourcing, Architecture migration.

Abstract

The article addresses the issue of migrating applications, particularly those following the Domain-Driven Design (DDD) architecture, to the Command Query Responsibility Segregation (CQRS) paradigm with Event Sourcing. Long-standing systems often need help with problems related to inflexible, outdated architecture, and dependencies, leading to increased maintenance costs. The paper examines the advantages of DDD and proposes CQRS as a viable alternative, focusing on improving productivity and scalability. The main objective of the work is to assess a secure path for migrating a project from DDD architecture to the CQRS and Event Sourcing architecture and to determine the migration roadmap. The article conducts an experiment in which migration of a test project is performed, evaluating the time, effort, and results of the migration. The research methodology includes evaluating complexity using McCabe's Cyclomatic Complexity metric and assessing performance through the execution time of system methods. The experiment is conducted on a typical project – a task-tracking system. The results of implementing CQRS show a fourfold increase in the number of classes and a 50% increase in the number of lines of code. However, this increase is justified as it improves modularity, transparency, and manageability during development, ultimately facilitating system maintenance and significantly enhancing overall system productivity. It is worth noting that the overall cyclomatic complexity of the system remains almost unchanged. In summary, the article examines the assessment of migrating a project from DDD architecture to CQRS and Event Sourcing, combining theoretical findings with practical experimentation. It provides valuable insights into the advantages, disadvantages, and challenges of implementing CQRS architecture in complex information systems.

References

Evans E. Domain-Driven Design: Tackling Complexity in the Heart of Software, 2004. ISBN: 978-0321125217.

Vernon V. Implementing Domain-Driven Design, 2013. ISBN: 978-0321834577.

Fowler M. Bounded Context, 2014. URL: https://martinfowler.com/bliki/BoundedContext.html.

Young G. CQRS Documents by Greg Young, 2010. Pages: 50–52. URL: https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf.

Betts D. Dominguez J. Melnik G. Simonazzi F. Subramanian M. Young G. Exploring CQRS and Event Sourcing: A journey into high scalability, availability, and maintainability with Windows Azure, 2013. ISBN: 978-1621140160.

Practical and focused guide for survival in post-CQRS world. Projections. URL: http://cqrs.wikidot.com/doc:projection.

Kenneth T. Introduction to Domain Driven Design, CQRS and Event Sourcing, 2013. URL: https://www.kenneth-truyers.net/2013/12/05/introduction-to-domain-driven-design-cqrs-and-event-sourcing/.

Salvatierra G. Mateos C. Crasso M. Legacy System Migration Approaches, 2013. DOI: 10.1109/TLA.2013.6533975.

Brodie M. L. Stonebraker M. Ai S. DARWIN: On the Incremental Migration of Legacy Information Systems, 1995.

Breitmayer M. Arnold L. La Rocca S. Reichert M. Deriving Event Logs from Legacy Software Systems, 2023. DOI: 10.1007/978-3-031-27815-0_30.

McCabe T. J. A Complexity Measure, 1976. DOI: 10.1109/TSE.1976.233837.

Vernon V. Effective Aggregate Design, 2011. Parts I – III.

Frolov M. TaskTrackingSystem repository on GitHub, 2023.

SonarCloud Online Code Review as a Service Tool. URL: https://sonarcloud.io/.

Downloads

Published

2024-06-12