Questions tagged [akka-persistence]

Akka persistence enables stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster.

Akka persistence enables stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster.

The key concept behind Akka persistence is that only changes to an actor's internal state are persisted but never its current state directly (except for optional snapshots). These changes are only ever appended to storage, nothing is ever mutated, which allows for very high transaction rates and efficient replication. Stateful actors are recovered by replaying stored changes to these actors from which they can rebuild internal state. This can be either the full history of changes or starting from a snapshot which can dramatically reduce recovery times. Akka persistence also provides point-to-point communication channels with at-least-once message delivery semantics.

Source: http://doc.akka.io/docs/akka/snapshot/scala/persistence.html

297 questions
25
votes
1 answer

Axon Framework vs Eventuate comparison

We are currently doing some research about CQRS and Event Sourcing and found two major frameworks taking care of these two concerns: Axon Framework and Eventuate. Both are continuesly developed, while Eventuate is now more actively developed in the…
Stefano L
  • 1,486
  • 2
  • 15
  • 36
12
votes
2 answers

How to run Play 2.2.x with Akka 2.3.x?

Is there any way to combine akka 2.3 and play 2.2? For now I'm getting AbstractMethodError while running such application. I need to have them both in one app because Akka 2.3 comes with very useful akka persistence module which is very reliable(in…
12
votes
4 answers

CQRS + Event Sourcing implementation using akka-persistence

I want to use akka-persistence event sourcing feature in order to implement CRQS + Event Sourcing idea in my new project. The problem is that besides the documentation (http://doc.akka.io/docs/akka/snapshot/scala/persistence.html) I couldn't find…
Mequrel
  • 727
  • 6
  • 12
10
votes
2 answers

Akka Persistence Query event stream and CQRS

I'm trying to implement read side in my ES-CQRS architecture. Let's say I have a persistent actor like this: object UserWrite { sealed trait UserEvent sealed trait State case object Uninitialized extends State case class User(username:…
Branislav Lazic
  • 14,388
  • 8
  • 60
  • 85
10
votes
1 answer

Event-sourcing with akka-persistance: growing state as list?

I am designing a backend using CQRS + Event sourcing, using Akka + Scala. I am not sure about how to handle a growing state. For instance, I will have a growing list of users. To my understanding, each user will be created following a UserCreated…
ticofab
  • 7,551
  • 13
  • 49
  • 90
9
votes
1 answer

Akka: correct pattern for syncing state between two actors

In the process of rewriting the deprecated persistentView in Akka, I have a read actor that needs to snapshot its state and the journal events offset is has read so far. To stop the view actor requiring serialisation of the composite data structure…
Maths noob
  • 1,684
  • 20
  • 42
8
votes
1 answer

At-least-once delivery using Akka Persistence and the Extra-Cameo pattern

I am developing an application that uses Akka, in which Actors are designed to avoid the Request-Response pattern. Using the Extra or the Cameo pattern is possible to model interactions among actors as a "stream" of messages. The figure below…
riccardo.cardin
  • 7,971
  • 5
  • 57
  • 106
8
votes
1 answer

What a use case for Akka persistent actor?

I'm in mess about the applicability of Akka Persistence, and the persistent actors, when I should use a persistent Actor? Taking for example from a Cart module of a given Shopping Application, will be every user's Cart Session a persistent actor…
7
votes
2 answers

Kafka as an Akka-persistence journal

Among the different options of a write-journal to implement Event Sourcing, Kafka seems a very reasonable choice from "outside": It has a great ecosystem It is well documented It naturally supports streaming and listeners However, looking into…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
7
votes
1 answer

Akka persistence with confirmed delivery gives inconsistent results

I have been playing around with Akka Persistence and have written the following program to test my understanding. The problem is that I get different results each time I run this program. The correct answer is 49995000 but I don't always get that. …
thewaterwalker
  • 322
  • 2
  • 11
6
votes
1 answer

Is there a way to use snapshots with PersistenceQuery

PersistentView has been deprecated in akka 2.4. The docs advise to switch to PersistenceQuery instead. However PersistenceQuery seems to be limited to the event journal only, without a capability to query the snapshot store. Restoring a state from a…
kostja
  • 60,521
  • 48
  • 179
  • 224
6
votes
3 answers

DDD/CQRS Querying Events

I was looking at post's on querying in application designed with approach Event Sourcing/DDD/CQRS. As I understand events are changes to the state of a domain object. The changes to state will be maintained as history/events in DB(any of sql/no…
6
votes
1 answer

Uniqueness of persistenceId in akka-persistence

I'm using the scala api for akka-persistence to persist a group of actor instances that are organized into a tree. Each node in the tree is a persistent actor and is named based on the path to that node from a 'root' node. The persistenceId is set…
Brendan
  • 743
  • 6
  • 13
5
votes
2 answers

Different use case for akka cluster aware router & akka cluster sharding?

Cluster aware router: val router = system.actorOf(ClusterRouterPool( RoundRobinPool(0), ClusterRouterPoolSettings( totalInstances = 20, maxInstancesPerNode = 1, allowLocalRoutees = false, useRole = None …
atline
  • 28,355
  • 16
  • 77
  • 113
5
votes
1 answer

How should I structure Persistence Actors in Akka persistence?

How should I structure my Actors in Akka persistent (Eventsourcing/CQRS) ? Hierarchical Parallel I have these domain objects in my ecommerce application User - User can create account Store - User can create store Product - User can add products…
user794783
  • 3,619
  • 7
  • 36
  • 58
1
2 3
19 20