Persisting the state to LevelDB
Akka persistence defines the mechanism to store the state of your actors by storing either a sequence of events or complete snapshots. However, Akka persistence does not impose which underlying technology to use as the data store for them. Akka persistence basically acts as the API. A simple solution to understand how Akka persistence works is LevelDB. LevelDB stores events in the local filesystem, and it is not a replicated journal. That is why it is not recommended that you use LevelDB in a production environment.
In this recipe, we will review how to define which underlying technology we want for persistence, in this case, LevelDB. LevelDB provides a plugin for the journal, but not for snapshots. That is why we will not talk about snapshots in this recipe.
Getting ready
To step through this recipe, we need to import the hello-Akka
project in the IDE; other prerequisites are the same as earlier as we have downloaded the akka-persistence
dependency.