Applying Event Sourcing to Occasionally Connected Systems
Kimpimäki, Jami-Petteri (2022)
Kimpimäki, Jami-Petteri
2022
Automaatiotekniikan DI-ohjelma - Master's Programme in Automation Engineering
Tekniikan ja luonnontieteiden tiedekunta - Faculty of Engineering and Natural Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2022-10-11
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202209137039
https://urn.fi/URN:NBN:fi:tuni-202209137039
Tiivistelmä
As an information storing technique, event sourcing provides some useful properties over more traditional techniques. There is value for both application developers and end-users to be able to inspect the whole history of the application states.
Event sourcing is usually used in environments with a constant network connection and a centralized database. This thesis aimed to provide necessary means to allow use of event sourcing in occasionally connected systems.
This thesis started off the research by assuming an occasionally connected, event sourced system with a distributed multi-leader database. Problems emerging from this approach were first identified, and then solved on a conceptual level by using methods from existing literature and research. At last, a fictional case study was conducted to produce a system showcasing that the concepts introduced can be applied in practice.
There were a total of three primary problems that were identified. By making event sourcing data model bi-temporal, retroactive sharing of events proved to be achievable without violating the immutability and append-only principle of event sourcing. Conflict and concurrency detection and handling emerging from moving from single leader to multi-leader replication revealed to be a well-known problem in distributed system research around data replication. Last problem was how the system can give guarantees that information it provides to external systems will not change. This proved to be solvable by applying stability properties of distributed systems to the event sourced data model, which allowed to identify a point in the event log dividing the log into stable and unstable parts. These results together provide a foundation for building occasionally connected event sourced systems.
Event sourcing is usually used in environments with a constant network connection and a centralized database. This thesis aimed to provide necessary means to allow use of event sourcing in occasionally connected systems.
This thesis started off the research by assuming an occasionally connected, event sourced system with a distributed multi-leader database. Problems emerging from this approach were first identified, and then solved on a conceptual level by using methods from existing literature and research. At last, a fictional case study was conducted to produce a system showcasing that the concepts introduced can be applied in practice.
There were a total of three primary problems that were identified. By making event sourcing data model bi-temporal, retroactive sharing of events proved to be achievable without violating the immutability and append-only principle of event sourcing. Conflict and concurrency detection and handling emerging from moving from single leader to multi-leader replication revealed to be a well-known problem in distributed system research around data replication. Last problem was how the system can give guarantees that information it provides to external systems will not change. This proved to be solvable by applying stability properties of distributed systems to the event sourced data model, which allowed to identify a point in the event log dividing the log into stable and unstable parts. These results together provide a foundation for building occasionally connected event sourced systems.