Akka Persistence allows us to store and replay messages sent to PersistentActor and thus implements an event-sourcing approach. Before going into the details of the actors implementation, let's look at the arrangements we need to make in the project configuration.
We're going to use the H2 relational database for this project. Akka Persistence supports many different storage plugins, including a local filesystem for storing snapshots, and in our case, it appears to be a good idea to use the same database we used with doobie to underline the differences in the architectural style.
Again, we're using Flyway to create the structure of the database. The tables will be different though. This is the table that will ...