CRITICAL CAUSAL EVENTS IN SYSTEMS BASED ON CQRS WITH EVENT SOURCING ARCHITECTURE

Authors

  • O. A. Lytvynov Oles Honchar Dnipro National University, Dnipro, Ukraine, Ukraine
  • D. L. Hruzin Oles Honchar Dnipro National University, Dnipro, Ukraine, Ukraine

DOI:

https://doi.org/10.15588/1607-3274-2024-3-11

Keywords:

Service-Oriented Architecture, Event-Driven Architecture, Event Sourcing, Events synchronization, Domain Driven Design

Abstract

Context. The article addresses the problem of causal events asynchrony which appears in the service-oriented information systems that does not guarantee that the events will be delivered in the order they were published. It may cause intermittent faults occurring at intervals, usually irregular, in a system that functions normally at other times.

Objective. The goal of the work is the comparison and assessment of several existing approaches and providing a new approach for solving the causal events synchronization issue in application to the systems developed using Command Query Responsibility Segregation (CQRS) with Event Sourcing (ES) architecture approach.

Methods. Firstly, the method of estimation of the likelihood of causal events occurring within the systems as the foundation for choosing the solution is suggested. Based on the results of the analysis of several projects based on CQRS with ES architecture it shows that the likelihood of critical causal events depends on the relationships among entities and the use-cases connected with the entities. Secondly, the Container of Events method, which represents a variation of event with full causality history, adapted to the needs of CQRS with ES architecture systems, was proposed in this work. The variants of its practical implementation have also been discussed. Also, the different solutions, such as Synchronous Event Queues and variation of Causal Barrier method were formalized and assessed. Thirdly, the methods described have been discussed and evaluated using performance and modification complexity criteria. To make the complexity-performance comparative assessment more descriptive the integrated assessment formula was also proposed.

Results. The evaluation results show that the most effective solution of the issue is to use the Container of Events method. To implement the solution, it is proposed to make the modifications of the Event Delivery Subsystem and event handling infrastructure.

Conclusions. The work is focused on the solution of the critical causal events issue for the systems based on CQRS with ES architecture. The method of estimation of the likelihood of critical causal events has been provided and different solutions of the problem have been formalized and evaluated. The most effective solution based on Container of Events method was suggested.

Author Biographies

O. A. Lytvynov, Oles Honchar Dnipro National University, Dnipro, Ukraine

PhD, Associate Professor of the Department of Electronic Computing Machinery

D. L. Hruzin, Oles Honchar Dnipro National University, Dnipro, Ukraine

Postgraduate student of the Department of Electronic Computing Machinery

References

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

Martin R. C. Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall, 2019, 464 p. ISBN: 978-0132350884.

Newman S. Building Microservices: Designing Fine-Grained Systems 2nd Edition. O’Reilly, 2021, 500 p. ISBN: 978-1492034025.

Michelson B. M. Event-Driven Architecture Overview, Patricia Seybold Group and Elemental Links. Boston, 2011, 9 p. DOI: 10.1571/bda2-2-06cc.

Taylor H., Yochem A., Phillips L. et al. Event-Driven Architecture: How SOA Enables the Real-Time Enterprise. Addison-Wesley Professional, 2009, 272 p. ISBN: 978-0321591388.

Neamtiu I., Dumitras T. Cloud software upgrades: Challenges and opportunities, 2011 International Workshop on the Maintenance and Evolution of Service-Oriented and Cloud-Based Systems: status, 26–26 September 2011: proceedings. Williamsburg: IEEE, 2011, pp. 1–10. ISBN: 978-1457706479.

Tarkoma S. Publish / Subscribe Systems: Design and Principles. Wiley, 2012, 352 p. ISBN: 978-1119951544.

Brandolini A. Introducing EventStorming [Electronic resource]. Access mode: https://leanpub.com/introducing_eventstorming.

Stopford B. Designing Event-Driven Systems. O’Reilly Media, 2018, 171 p. ISBN: 978-1492038221.

Garofolo E. Practical Microservices. Build Event-Driven Architectures with Event Sourcing and CQRS. Pragmatic Bookshelf, 2020, 292 p. ISBN: 978-1680507799.

Hoffman K. Building Microservices with ASP.NET Core / K. Hoffman. O’Reilly Media, 2017, 232 p. ISBN: 978-1491961735.

Young G. CQRS Documents by Greg Young [Electronic resource]. Access mode: https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf.

Young G. Event Centric: Finding Simplicity in Complex Systems. Addison-Wesley Professional, 2017, 560 p. ISBN: 978-0321768223.

Burckhardt S. Principles of Eventual Consistency (Foundations and Trends(r) in Programming Languages). Now Publishers, 2014, 170 p. ISBN: 978-1601988584.

Practical and focused guide for survival in post-CQRS world. Projections. [Electronic resource]. Access mode:http://cqrs.wikidot.com/doc:projection.

Comartin D., Young G. Answers your Event Sourcing questions! [Electronic resource]. Access mode:https://codeopinion.com/greg-young-answers-your-eventsourcing-questions.

Lloyd W., Freedman M. J., Kaminsky M. et al. Don’t Settle for Eventual Consistency, Communications of the ACM, 2014, Vol. 57, Issue 5, pp. 61–68. DOI: 10.1145/2596624.

Lamport L. Time, clocks, and the ordering of events in a distributed system, Communications of the ACM, 1978, Vol. 21, Issue 7, pp. 558–565. DOI: 10.1145/359545.359563.

Mostéfaoui A., Raynal M., Tredan G. On the Fly Estimation of the Processes that Are Alive in an Asynchronous Message-Passing System, IEEE Transactions on Parallel and Distributed Systems, 2009, Vol. 20, Issue 6. pp. 778–787. DOI: 10.1109/TPDS.2009.12.

Microsoft documentation. CQRS pattern. Implementation issues and considerations [Electronic resource]. Access mode:https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs#implementation-issues-andconsiderations.

Young G. Versioning in an Event Sourced System [Electronic resource]. Access mode: https://leanpub.com/esversioning.

Schwarz R., Mattern F. Detecting causal relationships in distributed computations: In search of the holy grail, Distributed Computing, 1994, Vol. 7, pp. 149–174. DOI: 10.1007/BF02277859.

Vernon V. Implementing Domain-Driven Design. Addison Wesley, 2013, 656 p. ISBN: 978-0321834577.

Hens P., Snoeck M., Poels G. et al. A Petri Net Formalization of a Publish-Subscribe Process System, Social Science Research Network, 2011. DOI: 10.2139/ssrn.1886198.

Farmer W. M. The seven virtues of simple type theory, Journal of Applied Logic, 2008, Vol. 6, Issue 3, pp. 267–286. DOI: 10.1016/j.jal.2007.11.001.

Muhl G., Fiege L., Pietzuch P. Distributed Event-Based Systems. New York, Springer-Verlag, 2006, 388 p. ISBN: 978-3540326519.

Baldoni R., Contenti M., Piergiovanni S. T. et al.Modelling Publish/Subscribe Communication Systems: Towards a Formal Approach, Object-Oriented Real-Time Dependable Systems : 8th IEEE International Workshop, 15–17 January 2003 : proceedings. Guadalajara, WORDS, 2003, pp. 304–311. DOI: 10.1109/WORDS.2003.1218097.

Araujo J. P., Arantes L., Duarte E. P. et al. VCube-PS: A causal broadcast topic-based publish/subscribe system, Journal of Parallel and Distributed Computing, 2019, Vol. 125, pp. 18–30. DOI: 10.1016/j.jpdc.2018.10.011.

Ohlbach H. J., Koehler J. Modal logics, description logics and arithmetic reasoning, Artificial Intelligence, 1999, Vol. 109, pp. 1–31. DOI: 10.1016/S0004-3702(99)00011-9.

Badra F. Case Adaptation with Modal Logic: The Modal Adaptation, Case-Based Reasoning Research and Development: 22nd International Conference Reason, 29 September 2014 – 1 October 2014: proceedings. Cork, ICCBR, 2014.

Fidge C. J. Timestamps in Message-Passing Systems that Preserve Partial Ordering, Australian Computer Science Communications, 1988, Vol. 10, No. 1, pp. 56–66.

Mattern F. Algorithms for distributed termination detection, 1987. DOI: 10.1007/BF01782776.

Singh A. Matrix Clock Synchronization in the Distributed Computing Environment, International Journal of Computer Science and Information Technologies, 2015, Vol. 6, Issue 4. pp. 3510–3513.

Guidec F., Launay P., Mahéo T. Causal and Δ-causal broadcast in opportunistic networks, Future Generation Computer Systems, 2021, Volume 118, Issue 1, pp. 142–156. DOI: 10.1016/j.future.2020.12.024.

Wan F., Singh M. P. Commitments and Causality for Multiagent Design, 2nd International Joint Conference on Autonomous Agents and Multiagent Systems, 14 – 18 July 2003: proceedings. Melbourne: AAMAS, 2003, pp. 749–756. DOI: 10.1145/860575.860696.

Preguiça N. M., Bauqero C., Almeida P. S. Brief announcement: efficient causality tracking in distributed storage systems with dotted version vectors, ACM symposium on Principles of distributed computing, 2012, pp. 335–336 DOI: 10.1145/2332432.2332497.

Zhou S., Cai W., Turner S. J. Critical causal order of events in distributed virtual environments, ACM Transactions on Multimedia Computing, Communications and Applications, 2007, Vol. 3. DOI: 10.1145/1236471.1236474.

Baldoni R., Prakash R., Raynal M. Efficient Delta-Causal Broadcasting, International Journal of Computer Systems Science and Engineering, 1998, Vol. 13, pp. 263–271. DOI: 10.3923/jas.2009.1711.1718.

Schiper A., Eggli J., Sandoz A. A New Algorithm to Implement Causal Ordering, Distributed Algorithms : 3rd International Workshop, 26–28 September 1989: proceedings. Nice, pp. 219–232. DOI: 10.1007/3-540-51687-5_45.

Carzaniga A., Rosenblum D. S., Wolf A. L. Design and Evaluation of a Wide-Area Event Notification Service, ACM Transactions on Computer Systems (TOCS), 2001, Vol. 19, Issue 3, pp. 332–383. DOI: 10.1145/380749.380767.

Esposito C., Cotroneo D., Gokhale A. Reliable Publish/Subscribe Middleware for Time-sensitive Internet-scale Applications, Distributed Event-Based Systems : the 3rd ACM International Conference, 6–9 July 2009 : proceedings. Nashville, DEBS, 2009, pp. 1–12. DOI: 10.1145/1619258.1619280.

Microsoft. Saga distributed transactions pattern [Electronic resource]. Access mode: https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/saga/saga.

DBB Software’s official company site [Electronic resource]. Access mode: https://dbbsoftware.com/.

Berardi D., Calvanese D., Giacomo G. Reasoning on UML Class Diagrams, Artificial Intelligence, 2005, Vol. 168, Issue 1–2, pp. 70–118. DOI: 10.1016/j.artint.2005.05.003.

Calvanese D., Lenzerini M., Nardi D. A unified framework for class based representation formalisms, Principles of Knowledge Representation and Reasoning : 4th International Conference, 24–27 May 1994 : proceedings. San Francisco, pp. 109–120.

Danforth S., Tomlinson C. Type theories and object-oriented programming, ACM Computing Surveys, 1988, Vol. 20, Issue 1, pp. 29–72. DOI: 10.1145/62058.62060.

Zaman Q., Nadeem A., Sindhu M. A. Formalizing the use case model: A model-based approach, PLoS ONE, 2020, Vol. 15, Issue 4. DOI: 10.1371/journal.pone.0231534.

Kautz O., Rumpe B., Wachtmeister L. Semantic Differencing of Use Case Diagrams, Journal of Object Technology, 2022, Vol. 21, Issue 3, pp. 1–14. DOI: 10.5381/jot.2022.21.3.a5.

Rosenberg D., Stephens M. Use Case Driven Object Modeling with UML. Theory and Practice. Apress, 2013, 472 p. ISBN:978-1430243052.

Genova G., Llorens J., Quintana V. Digging into use case relationships, The Unified Modeling Language : 5th International Conference, 30 September – 4 October 2002 : proceedings. Berlin, UML, 2002, pp. 115–127. DOI: 10.1007/3-540-45800-X_10.

Daan. The Impact of Duplicate Code [Electronic resource] / Daan. – Access mode: https://levelup.gitconnected.com/theimpact-of-duplicate-code-31c0bceab831.

How Event-Driven Architectures Benefit from Stream Processing [Electronic resource]. Access mode:https://pandio.com/event-streams-queues/

Seshadri P. Handling out of order events in a Event driven systems [Electronic resource]. Access mode:https://medium.com/@prabhu.seshadri/handling-out-of-orderevents-in-a-event-driven-systems-93349bd20c26.

Lombardi A. WebSocket. Lightweight Client-Server Communications 1st Edition. O’Reilly, 2015, 144 p. ISBN:978-1449369279.

Hruzin D. Link to GitHub repository with experiment [Electronic resource]. Access mode:https://github.com/dmitryhruzin/causal-event-experiment.

Mens T. Research trends in structural software complexity, Computer Science, Engineering, 2016. DOI: 10.48550/arXiv.1608.01533.

Bogdan St. Software development cost estimation methods and research trends, Computer Science, 2003, Vol. 5, pp. 67–86. DOI: 10.7494/csci.2003.5.1.3608.

Sarala S., Jabbar A. Information flow metrics and complexity measurement, Computer Science and Information Technology : 3rd International Conference, 9–11 July 2010 : proceedings. Chengdu, ICCSIT, 2010,Vol. 2. pp. 575–578. DOI: 10.1109/ICCSIT.2010.5563667.

Misra S. Measurement of Cognitive Functional Sizes of Software, International Journal of Software Science and Computational Intelligence, 2009,Vol. a, Issue 2, pp. 91–100. DOI: 10.4018/jssci.2009040106.

Beyer D., Häring P. A Formal Evaluation of DepDegree Based on Weyuker’s Properties, Program Comprehension : the 22nd International Conference, 2–3 June 2014 : proceedings. Hyderabad, ICSE, 2014, pp. 258–261. DOI: 10.1145/2597008.2597794.

McCabe T.J. A Complexity Measure, IEEE Transactions on Software Engineering, 1976, Vol. SE-2, Issue 4, pp. 308–320. DOI: 10.1109/TSE.1976.233837.

Halstead M. H. Elements of Software Science. New York, Elsevier, 1977, 128 p. ISBN: 978-0444002051.

Sync-Queue Node.js package. GitHub [Electronic resource]. Access mode: https://github.com/tessel/sync-queue.

Amazon Simple Queue Service [Electronic resource]. Access mode: https://aws.amazon.com/sqs/.

Apache Kafka [Electronic resource]. Access mode:https://kafka.apache.org/.

Blest D. Theory & Methods: Rank Correlation – an Alternative Measure, Australian & New Zealand Journal of Statistics, 2000, Vol. 42, Issue 1, pp. 101–111. DOI: 10.1111/1467-842X.00110.

Downloads

Published

2024-11-03

How to Cite

Lytvynov, O. A., & Hruzin, D. L. (2024). CRITICAL CAUSAL EVENTS IN SYSTEMS BASED ON CQRS WITH EVENT SOURCING ARCHITECTURE. Radio Electronics, Computer Science, Control, (3), 119. https://doi.org/10.15588/1607-3274-2024-3-11

Issue

Section

Progressive information technologies