4 ms·
The Virtual Actor model implemented in Orleans differs from what OTP & Akka offer in that Virtual Actors have managed lifecycles and are never created or destro
by reubenbond 11y ago
The Virtual Actor model implemented in Orleans differs from what OTP & Akka offer in that Virtual Actors have managed lifecycles and are never created or destroyed. Instead, they are activated when needed (fetching state from storage if needed) and deactivated when idle.
This helps you to reason about your system. You can never know if a node will fail at any point in time (in any system), but with Orleans you can be sure that an actor will be reactivated on a surviving node in event of a failure. In other words, you can continually message actor X without worrying about ever having to reinstantiate it on another node due to failure.
By default, Orleans maintains an eventually consistent mapping of actors to nodes (called silos) and relies on the storage layer to give strong consistency. Most of the default storage providers offer strong consistency.
By the way, Service Fabric includes an implementation of Virtual Actors which differ in a couple of ways:
1. The actors are placed using consistent hashing. Actor Ids are mapped to a range of partitions, the replicas of which can be moved between nodes in case of failure.
2. Actor state is physically stored on the actor node by default. Because Service Fabric uses distributed consensus to implement stateful services, they can persist each actors state in the partition which it belongs to. The state is replicated to a quorum of replicas on each write.
- saryant 11y agoAkka has added something along those lines with Akka Persistence and the new cluster sharding features. Actors can passivate (gracefully stop) and the cluster manager will route messages that would've gone to that actor to another actor in the cluster. Because the actors are persistent, they can be spun back up at their previous state on any cluster member.
- reubenbond 11y agoAkka persistence is different. It doesn't give you managed lifecycles like in the Virtual Actor model - so you aren't insulated from failures and you still have to consider when to create/recreate an actor. It gives you Event Sourcing / Command Sourcing (depending on how you use it). ES is a work-in-progress for Orleans, but many of us are using our own ES systems. For an implementation of Virtual Actors on the JVM, check out Orbit from Electronic Arts / BioWare: http://orbit.bioware.com/ http://orbit.bioware.com/
- dave_ops 11y agoSo you reinvented the vnode from riak_core?
- reubenbond 11y agoThe first Orleans paper is from 2009 or 2010, so I don't think they are reinventing riak core.