A replicated Akka Persistence journal backed by FoundationDB
APACHE-2.0 License
Replicated Akka Persistence journal and snapshot store backed by FoundationDB.
This version of akka-persistence-foundationdb
depends on Akka 2.6.13 and Foundation 6.2.x. It has been published for Scala 2.13.5.
FoundationDbReadJournal
To activate the journal plugin, add the following line to your Akka application.conf
:
akka.persistence.journal.plugin = "foundationdb-journal"
This will run the journal with its default settings. The default settings can be changed with the configuration properties defined in reference.conf:
These issues are likely to be resolved in future versions of the plugin.
Please keep in mind that event deletion has a different behavior depending on tag types. If you use compact tags, then tag is a reference to your event. If you delete the event from the journal, tag will point to the empty event and will be automatically cleared at the next eventsByTag query call. At the other hand, if your tag is rich, it will contain the whole event and won't be deleted, so your eventsByTag query will work as expected.
To activate the snapshot-store plugin, add the following line to your Akka application.conf
:
akka.persistence.snapshot-store.plugin = "foundationdb-snapshot-store"
This will run the snapshot store with its default settings. The default settings can be changed with the configuration properties defined in reference.conf:
It implements the following Persistence Queries:
currentPersistenceIds
, (persistenceIds
is not implemented yet)eventsByPersistenceId
, currentEventsByPersistenceId
eventsByTag
, currentEventsByTag
All live queries are implemented using database push mechanism and don't use polling. It allows very low latencies between the writing event to the journal and it's replication to the query side.
Persistence Query usage example to obtain a stream with all events tagged with "someTag" with Persistence Query:
val queries = PersistenceQuery(system).readJournalFor[FoundationDbReadJournal](FoundationDbReadJournal.Identifier)
queries.eventsByTag("someTag", Offset.noOffset)
Compared to other journals, there are no hard limits regarding the amount of tags per event. It's been tested to work with 1000 tags per event.