RBMHTechnology / eventuate

Global-scale event sourcing and event collaboration with causal consistency (This project is in maintenance mode. Only critical bugs will be fixed, but there is no more feature development.).
http://rbmhtechnology.github.io/eventuate/
Apache License 2.0
708 stars 99 forks source link

Causal event delivery #66

Closed krasserm closed 8 years ago

krasserm commented 9 years ago

Storing events in an order that is consistent with their causal relationship can be inefficient. When giving up causal storage order, Eventuate must re-order events before delivering them in order to preserve causality on application-level.

Applications should also also be able to disable causal delivery. This is useful for actors that manage Counter or MV-Register CRDTs, for example, for which causal delivery order is not relevant. Other application-specific actors and/or views may also want to turn off causal delivery if their state update operations commute.

krasserm commented 9 years ago

An initial implementation (M1) exists on branch wip-66-causal-event-delivery. In this implementation, event-sourced actors and views re-order events before delivering them to their event handler. It is assumed that an actor that handles a given event also handles all causally related events. Hence, these causally related events

  1. must pass all replication filters
  2. must be routed to that actor and
  3. must be handled by that actor

This is the case for some applications, such as Eventuate's operation-based CRDTs, for example. However, the above assumptions cannot be made in general because application-specific replication filters, routings and event handlers can prevent causally related events from being handled by a certain actor.

krasserm commented 8 years ago

Eventuate will continue storing events in causal order.