These are chat archives for RBMHTechnology/eventuate

18th
Oct 2016
Martin Krasser
@krasserm
Oct 18 2016 05:54

As I see it, akka persistence isn't CP by its own. It needs Cluster Sharding, doesn't?

The only allowed mode of operation for a PersistentActor is running it as global singleton. If an application fails to do so, the behavior of a PersistentActor is undefined (most likely, this will corrupt the underlying event log). The consequence is that a PersistentActor exhibits CP properties because that singleton also represents a consistency boundary.

How you enforce the global singleton is another question. Using Akka Cluster Sharding is one option but this only works if you're additionally using the (commercial) Split Brain Resolver. This is needed because the shard coordinator must be a singleton too. Without the Split Brain Resolver, Akka Cluster may create more than one coordinator instance in a split brain scenario which might lead to multiple persistent actors with the same id.

How we could prevent the case where we end up with two instances with the same aggregateId running in different locations?

That is the responsibility of an application.

Unique key generation doesn't ensures unique Actor across locations

It prevents you from accidentially creating a new aggregateId more than once but Eventuate doesn't prevent you from creating multiple instances of an actor with the same aggregateId multiple times. This is again responsibility of the application.

Martin Krasser
@krasserm
Oct 18 2016 10:41
Please be aware of the breaking CRDT changes in RBMHTechnology/eventuate#333 (just merged to master). Sorry for the inconvenience.