Concepts such as event sourcing and CQRS allow an application to store all events that happen in the system using a persistence mechanism. The events can not be mutated and current state of the system in any point in history can be reconstructed by replaying all the events until that point. For performance reasons obviously the state can be cached using a snapshot. But the undisputable advantage of this approach is that the whole history of events (including user actions, behaviour or system messages - anything we decide to store) is available to us rather than just the current state. Event sourcing was thoroughly discussed before for instance in or and CQRS in or .
In this post we will discuss how we can store and further use these data by connecting Akka, Cassandra and Spark, focusing mostly on the configuration, Akka serialization and Akka-analytics project. Later I will follow up with another blog post building on top of this with an example of using machine learning techniques to obtain some insights to help optimize future decisions and application workflow.