ENGINEERING OF SOFTWARE SYSTEMS BASED ON SNAPSHOT-CENTRIC CQRS WITH EVENT SOURCING ARCHITECTURE
DOI:
https://doi.org/10.20535/kpisn.2026.1.350992Keywords:
CQRS, Event Sourcing, Software ArchitectureAbstract
Background. Command Query Responsibility Segregation (CQRS) with Event Sourcing (ES) is a widely adopted solution for designing scalable and high-performance information systems. However, classical CQRS with ES implementations are often associated with increased complexity in development and maintenance.
Objective. The goal of this study is to simplify the development and maintenance of software systems built on CQRS with ES by introducing an alternative variation of the architecture.
Methods. The classical architectural variation was analyzed, and the components that increase the complexity of system development and maintenance were identified. Based on this analysis, an alternative architectural variation (mCQRS) is proposed, that uses a lower-complexity component set. The solution is based on a relational database in which aggregate state snapshots are treated as the source of truth, thereby reducing implementation and maintenance complexity and facilitating potential migration to other architectural variations.
Results. Representative test projects were developed for both the classical and the proposed CQRS with ES variations. Cyclomatic complexity values for a typical command execution workflow (120 for Classical CQRS and 82 for mCQRS) indicate a 31.67% decrease in complexity. Performance measurements show that server response time for queries is identical for both variations (44 ms), whereas the end-to-end time to reach system consistency for commands is 268 ms for Classical CQRS and 347 ms for mCQRS, corresponding to a 22.76% decrease in performance. Despite this degradation, write-operation throughput remains high in the context of established industry practices.
Conclusions. The proposed approach improves the efficiency of development and maintenance and reduces the required level of developer expertise; it is suitable for systems in which write-operation performance is not critical
References
M. Fowler, “Patterns of Enterprise Application Architecture”, Addison-Wesley Professional, 2002. - 560 p. ISBN: 978-0321127426. Retrieved from: https://raw.githubusercontent.com/ZoranLi/Books1/master/Patterns%20of%20Enterprise%20Application%20Architecture.pdf.
B. Woolf and G. Hohpe, “Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions”, Addison-Wesley Professional, 2004. - 736 p. ISBN: 978-0321200686. Retrieved from: https://github.com/ivanarandac/Books/blob/master/Enterprise%20Integration%20Patterns%20-%20Designing%2C%20Building%20And%20Deploying%20Messaging.pdf.
E. Evans. “Domain-Driven Design: Tackling Complexity in the Heart of Software”, Addison-Wesley Professional, 2004. - 534 p. ISBN: 978-0321125217. Retrieved from: https://github.com/gmoral/Books/blob/master/Domain%20Driven%20Design%20Tackling%20Complexity%20in%20the%20Heart%20of%20Software%20-%20Eric%20Evans.pdf.
Neal Ford, Rebecca Parsons, Patrick Kua and Pramod Sadalage, “Building evolutionary architectures (2nd ed.)”, 2022, O'Reilly Media, Sebastopol, CA, 262. Retrieved from: https://www.thoughtworks.com/content/dam/thoughtworks/documents/books/bk_building_evolutionary_architectures_second_edition_free_chapter.pdf.
Y. Zhong, “Using Event Sourcing and CQRS to Build a High Performance Point Trading System”, E-Business and Applications: 5th International Conference, Bangkok, 25 February 2019: proceedings. - New York: Association for Computing Machinery, 2019. - P. 16-19. DOI: 10.1145/3317614.3317632. Retrieved from: https://doi.org/10.1145/3317614.3317632.
D. Betts, J. Dominguez, G. Melnik, F. Simonazzi and M. Subramanian, “Exploring CQRS and Event Sourcing: A Journey into High Scalability, Availability, and Maintainability with Windows Azure (1st ed.)”, 2012, Microsoft patterns & practices. Retrieved from: https://download.microsoft.com/download/e/a/8/ea8c6e1f-01d8-43ba-992b-35cfcaa4fae3/cqrs_journey_guide.pdf.
M. Fowler, “CQRS”, [Electronic resource] Retrieved from: https://martinfowler.com/bliki/CQRS.html.
G. Young, “CQRS Documents by Greg Young”, [Electronic resource] / G. Young. - Retrieved from: https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf.
G. Young, “Event Centric: Finding Simplicity in Complex Systems”, Addison-Wesley Professional, 2017. - 560 p. ISBN: 978-0321768223. Retrieved from: https://books.google.com.ua/books/about/Event_Centric.html?id=pA2xuAAACAAJ&redir_esc=y.
H. Taylor, A. Yochem, L. Phillips et al., “Event-Driven Architecture: How SOA Enables the RealTime Enterprise”, Addison-Wesley Professional, 2009. - 272 p. ISBN: 978-0321591388. Retrieved from: https://www.oreilly.com/library/view/event-driven-architecture-how/9780321591388/.
M. Overeem, M. Spoor, S. Jansen et al., “An empirical characterization of event sourced systems and their schema evolution - Lessons from industry”, Journal of Systems and Software. - 2021. - Vol. 178, Issue 4.
DOI: 10.1016/j.jss.2021.110970.
Retrieved from: https://doi.org/10.1016/j.jss.2021.110970.
K. Truyers. “Introduction to Domain Driven Design, CQRS and Event Sourcing”, 2013 [Electronic resource] Retrieved from: https://www.kenneth-truyers.net/2013/12/05/introduction-to-domain-driven-design-cqrs-and-event-sourcing/.
V. Vernon. “Implementing Domain-Driven Design”, Addison Wesley, 2013. - 656 p. ISBN: 978-0321834577. Retrieved from: https://ptgmedia.pearsoncmg.com/images/9780321834577/samplepages/0321834577.pdf.
General Data Protection Regulation [Electronic resource]. - Retrieved from: https://gdpr-info.eu/.
N. Korkmaz, M. Nilsson, “Practitioners' view on command query responsibility segregation: thesis‚ MSc Information Systems”, Lund University: School of Economics and Management, - 2014. - 53 p. Retrieved from: https://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=4864802&fileOId=4864803.
O. Lytvynov, D. Hruzin, “On the migration of Domain-driven Design to CQRS with Event Sourcing software architecture”, Information Technology Computer Science Software Engineering and Cyber Security. - 2024. - Vol. 1, Issue 1. - P. 50-60.
DOI: 10.32782/IT/2024-1-7.
Retrieved from: https://doi.org/10.32782/IT/2024-1-7.
P. Revesz, “Relational Databases”, Introduction to Databases. - London: Springer, 2010. - Chapter 4. - 743 p.
DOI: 10.1007/978-1-84996-095-3_3.
Retrieved from: https://doi.org/10.1007/978-1-84996-095-3_3.
M. L. Brodie, M. Stonebraker, “Ai S. DARWIN: On the Incremental Migration of Legacy Information Systems”, 1995.
Retrieved from: https://dsf.berkeley.edu/papers/S2K-93-25.pdf.
M. Breitmayer, L. Arnold, S. La Rocca et al., “Deriving Event Logs from Legacy Software Systems”, Lecture Notes in Business Information Processing - 2023. - Vol. 468. - P. 409-421.
DOI: 10.1007/978-3-031-27815-0_30.
Retrieved from: https://doi.org/10.1007/978-3-031-27815-0_30.
D. Comartin, “Snapshots in Event Sourcing for Rehydrating Aggregates” [Electronic resource] Retrieved from: https://codeopinion.com/snapshots-in-event-sourcing-for-rehydrating-aggregates/.
O. Evsyukov, “The Bermuda Aggregate. And the Rescue of the Drowning”, [Electronic resource] Retrieved from: https://youtu.be/Br4TL-486ZM?t=1500.
O. Dudycz, “Snapshots in Event Sourcing” [Electronic resource] Retrieved from: https://www.eventstore.com/blog/snapshots-in-event-sourcing.
DBB Software's official company site [Electronic resource]. - Retrieved from: https://dbbsoftware.com/.
G. Young G. “Versioning in an Event Sourced System”, [Electronic resource] Retrieved from: https://leanpub.com/esversioning.
S. Kleanthous, “Event immutability and dealing with change” [Electronic resource] Retrieved from: https://www.eventstore.com/blog/event-immutability-and-dealing-with-change.
Z. Zheng, Shaoan Xie, Hong-Ning Dai et al., “An Overview of Blockchain Technology: Architecture, Consensus, and Future Trends”, Conference: 6th IEEE International Congress on Big Data.
DOI: 10.1109/BigDataCongress.2017.85.
Retrieved from: https://doi.org/10.1109/BigDataCongress.2017.85.
R. Laigner, A. Almeida, W. K. Assunção et al., “An Empirical Study on Challenges of Event Management in Microservice Architectures”, in An Empirical Study on Challenges of Event Management in Microservice Architectures,
DOI: 10.48550/arXiv.2408.00440.
Retrieved from: https://doi.org/10.48550/arXiv.2408.00440.
P. R. G. Vasconcellos, V. M. Bezerra, C. P. Bianchini, “Applying Event Sourcing in a ERP System: A Case Study”, XLIV Latin American Computer Conference, S√£o Paulo, 1-5 October 2018: proceedings. - IEEE, 2018. - P. 80-89.
DOI: 10.1109/CLEI.2018.00019.
Retrieved from: https://doi.org/10.1109/CLEI.2018.00019.
D. K. Pandiya, N. G. Charankar, “Optimizing Performance and Scalability in Micro Services with CQRS Design”, International Journal of Engineering Research & Technology. - 2024. - Vol. 13, Issue 4.
DOI: 10.17577/IJERTV13IS040284.
Retrieved from: https://doi.org/10.17577/IJERTV13IS040284.
B. Wu, D. Lawless, J. Bisbal et al., “The Butterfly Methodology: a gateway-free approach for migrating legacy information systems”, 1997.
DOI: 10.1109/ICECCS.1997.622311.
Retrieved from: https://doi.org/10.1109/ICECCS.1997.622311.
M. Breitmayer, L. Arnold, S. La Rocca, “Deriving Event Logs from Legacy Software Systems”, 2023. DOI: 10.1007/978-3-031-27815-0_30. Retrieved from: https://doi.org/10.1007/978-3-031-27815-0_30.
G. Salvatierra, C. Mateos, M. Crasso, “Legacy System Migration Approaches”, 2013. DOI: 10.1109/TLA.2013.6533975.
Retrieved from: https://doi.org/10.1109/TLA.2013.6533975.
G. Young, Link to GitHub repository [Electronic resource] - Retrieved from: https://github.com/gregoryyoung.
M. Driscoll, “The Publish-Subscribe Pattern”, wxPython Recipes: A Problem - Solution Approach. - Apress, 2017. - Chapter 4. - 369 p.
DOI: 10.1007/978-1-4842-3237-8_4.
Retrieved from: https://link.springer.com/chapter/10.1007/978-1-4842-3237-8_4?utm_source=researchgate.net&utm_medium=article.
P. Shaddel, “Understand and Implement Long-Polling and Short Polling in Node.js”, [Electronic resource] Retrieved from: https://levelup.gitconnected.com/understand-and-implement-long-polling-and-short-polling-in-node-js-94334d2233f3.
L. G. Cretu, “Event-driven replication in distributed systems”, India Software Engineering: the 4th Annual Conference, Thiruvananthapuram Kerala, 24-27 February 2011: proceedings. - New York: Association for Computing Machinery, 2011. - P. 95-98. DOI: 10.1145/1953355.1953367.
Retrieved from: https://doi.org/10.1145/1953355.1953367.
“Practical and focused guide for survival in post-CQRS world. Projections.”, [Electronic resource] Retrieved from: http://cqrs.wikidot.com/doc:projection.
D. Hruzin, Link to Zenodo repository, [Electronic resource] Access mode: https://zenodo.org/records/18263117. DOI: 10.5281/zenodo.18263116. Retrieved from: https://doi.org/10.5281/zenodo.18263116.
T. J. McCabe, “A Complexity Measure”, IEEETransactions on Software Engineering. - 1976. -Vol. SE-2, Issue 4. - P. 308-320.
DOI: 10.1109/TSE.1976.233837.
Retrieved from: https://doi.org/10.1109/TSE.1976.233837.
SonarQube Cloud official site [Electronic resource] Retrieved from: https://www.sonarsource.com/products/sonarcloud/.
D. Hruzin, Link to SonarQube scan report, [Electronic resource] Retrieved from: https://sonarcloud.io/component_measures?metric=complexity&selected=dmitryhruzin_CQRS-variations-test%3Atypescript%2Fapps&id=dmitryhruzin_CQRS-variations-test.
D. Hruzin, Link to GitHub repository, [Electronic resource] Retrieved from: https://github.com/dmitryhruzin/CQRS-variations-test/blob/main/scripts/run-measurement.js.
S. Gayathri Devi, Dr K. Selvam, “An abstract to calculate big O factors of time and space complexity of machine code”, Conference: International Conference on Sustainable Energy and Intelligent Systems (SEISCON 2011), Jan. 2021,
DOI: 10.1049/cp.2011.0483. Retrieved from: https://doi.org/10.1049/cp.2011.0483.
S. Burckhardt, “Principles of Eventual Consistency (Foundations and Trends(r) in Programming Languages)”, Now Publishers, 2014. - 170 p. ISBN: 978-1601988584.
Retrieved from: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/final-printversion-10-5-14.pdf.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Dmytro Hruzin, Oleksandr Lytvynov

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under CC BY 4.0 that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work