I'm currently doing some prototyping using Akka to implement the Domain Driven Design (DDD), CQRS and Event Sourcing patterns. I'm not sure whether I'm barking up the wrong tree, but my general preference would for the system to work something like this:
- Some command comes in to modify a given Aggregate Root (AR) entity
- If an Actor representing the AR is not already running in the system, create it _atomically_ (i.e. make sure you never have more than one Actor representing a specific entity)
- Actors should be removed after a period of idleness. This will avoid keeping actors around for entities with low interaction rates, but ensure 'hot' entities are kept in memory for performance (starting a new actor requires loading events from an event store in order to restore the memory image representing the entity state)
I'm wondering if there are any best practices with regard to creating actors atomically whilst avoiding any performance overload during the lookup process - i.e. if an actor is already running, you'd ideally not incur any sort of lookup related performance penalty.
This applies in a clustered environment as well as when running in a single JVM.
I have seen documentation on the Cluster Singleton Pattern, but my interpretation of this was that each ClusterSingletonManager would need to know up front what actors needed to be singletons. In my suggested design, you only create the Aggregate Root actors on the fly and thus do not know up front.
Would be interested in opinions on this.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Patrik Nordwall
Typesafe - Reactive apps on the JVM
Twitter: @patriknw
I really haven't thought through this in much detail, but could you somehow imagine a sort of 'multi-master' approach whereby you have multiple clusters and use consistent hashing to identify which cluster to use?
In this way, each cluster would have a singleton managing creation of entities. We'd maintain the "one actor per entity" requirement and at least be spreading the work out.
It kind of seems brute force and would require that clients be configured to know explicitly about each cluster. And I'm sure there are plenty of implementation challenges that I can't predict by just playing through this scenario in my head.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Am I right in thinking that using node roles (as you mentioned) would allow for the 'multi master' approach without separate clusters? The idea being to create as many node roles as I want 'masters' and have multiple cluster singletons, each associated with a unique role?
I suppose consistent hashing could be used to determine which singleton to use for a particular entity id.
Hmmmmm...just rethinking one of your ideas.
Am I right in thinking that using node roles (as you mentioned) would allow for the 'multi master' approach without separate clusters? The idea being to create as many node roles as I want 'masters' and have multiple cluster singletons, each associated with a unique role?
I suppose consistent hashing could be used to determine which singleton to use for a particular entity id.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Justin,the use case you so aptly summarize is indeed one which should become more and more commonplace. While I am currently too busy with other cool things to contribute directly I'd be delighted to take part in discussions on this topic. Patrik already outlined some promising strategies and it will be interesting to see where this ends up.Regards,
Roland
On Wednesday, October 23, 2013, Justin du coeur wrote:
[Just got back from my honeymoon, so catching up on back email.]A general observation: the description of the problem here sounds more or less structurally identical to what I'm going to be wrestling with for Querki in the next 4 months or so, as I scale up from a single node to a cluster. The details of the endpoint actors are different, but the high concept -- wanting at most one Actor for each named conceptual entity, starting that on-demand, and timing it out after an idle period -- is identical. And I get the impression that we're not the only ones using Akka for this pattern.So we may want to explore this particular problem in more depth in the coming months, with an eye towards coming up with some best-practices recommendations, or at least an understanding of the tradeoffs between the various options. (And maybe some generic framework code for folks to use.)For reference, my theorizing had wound up going in a somewhat different direction, basically starting with Glokka and expanding that into a cluster-wide distributed registration system; an outline can be found here. It's going to be another month or two before I start actually committing code, so any additional thoughts on the subject (including tradeoffs between the distributed-registrar approach I've been pondering vs. the discussion in this thread) would be welcomed. I'm not especially wedded to my architecture yet, and would love to have this lead to a proper OSS module, possibly even part of the standard Akka Patterns if it seems generally useful enough...
On Mon, Oct 7, 2013 at 8:54 AM, Andrew Easter <andrew...@gmail.com> wrote:
I'm currently doing some prototyping using Akka to implement the Domain Driven Design (DDD), CQRS and Event Sourcing patterns. I'm not sure whether I'm barking up the wrong tree, but my general preference would for the system to work something like this:
- Some command comes in to modify a given Aggregate Root (AR) entity
- If an Actor representing the AR is not already running in the system, create it _atomically_ (i.e. make sure you never have more than one Actor representing a specific entity)
- Actors should be removed after a period of idleness. This will avoid keeping actors around for entities with low interaction rates, but ensure 'hot' entities are kept in memory for performance (starting a new actor requires loading events from an event store in order to restore the memory image representing the entity state)
I'm wondering if there are any best practices with regard to creating actors atomically whilst avoiding any performance overload during the lookup process - i.e. if an actor is already running, you'd ideally not incur any sort of lookup related performance penalty. This applies in a clustered environment as well as when running in a single JVM.I have seen documentation on the Cluster Singleton Pattern, but my interpretation of this was that each ClusterSingletonManager would need to know up front what actors needed to be singletons. In my suggested design, you only create the Aggregate Root actors on the fly and thus do not know up front.Would be interested in opinions on this.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Are you including event sourcing in the scope of this?
Like Roland says, I definitely foresee this overall approach becoming much more commonplace, especially with akka-persistence on the horizon.
I think defining some best practices and patterns around using actors as unique persistent entities in a clustered environment would be extremely valuable.
I still need to actually have a crack at prototyping some of Patrik's ideas but am interested in exploring alternatives.
This is a really exciting area of research as it has the potential to offer a very compelling alternative to existing techniques for building an application domain layer. It feels like a really natural way of implementing domain driven design principles - it just makes sense.
Andrew
I guess my posts are still being censored by the moderators. Just in case my posts are at some point approved, that would just peachy. I've spent many months promoting this very approach, developing solutions for it. I have also made numerous presentations, ncluding several community events, including one just last week:
http://vimeo.com/63802840
http://skillsmatter.com/podcast/design-architecture/vaughn-vernon
http://www.meetup.com/ddd-denver/events/138251862/
Just in case this post makes it's way past protection...
To make your aggregates naturally transient, you will have to work around some basic problems. For example, when an Actor is stopped for some reason (just unloaded due to lack of use), the ActorRef will stay around for some time. So when you get ready to reload the Actor in question, the preexisting ActorRef will prevent the Actor from being created again.
Vaughn
On Wednesday, October 23, 2013 9:42:24 PM UTC-6, Andrew Easter wrote:Justin,Are you including event sourcing in the scope of this?
Like Roland says, I definitely foresee this overall approach becoming much more commonplace, especially with akka-persistence on the horizon.
I think defining some best practices and patterns around using actors as unique persistent entities in a clustered environment would be extremely valuable.
I still need to actually have a crack at prototyping some of Patrik's ideas but am interested in exploring alternatives.
This is a really exciting area of research as it has the potential to offer a very compelling alternative to existing techniques for building an application domain layer. It feels like a really natural way of implementing domain driven design principles - it just makes sense.
Andrew
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Are you including event sourcing in the scope of this?
Like Roland says, I definitely foresee this overall approach becoming much more commonplace, especially with akka-persistence on the horizon.
This is not true: stopped is stopped, existing ActorRefs effectively turn into deadLetters. But for such a system I would recommend not ever exposing the ActorRef of the actual aggregate to the rest of the system, but only go through its parent. Otherwise you will have all kinds of race conditions around starting/stopping aggregates.
Hi Roland,
Any time I post a message it takes at least hours before it is actually visible on the group. As soon as I post I see a message that says that if my post is approved by a moderator it will become visible. I am pretty sure it will happen again just after I click the Post button. That to me means censorship, but I have no idea who has time to read and approve every message to this group. The message previous to the one you are replying to didn't show up for about 10 hours after I posted it. In fact, at least one other message that was posted around 6 hours after my message, was visible to the group immediately after it was posted, and 4 hours before before mine that was posted 6 hours prior. Perhaps this is not the way you intend for this to work, but it is the way it has worked for me since my first post.
Also, as you know I have spent at least a few months pouring over the Akka Scala code. An observation I have made is that the name of an Actor is not usable again after it has been stopped, at least for some time. So when I try to dynamically reload the Actor I have to play tricks with it's name so I can get it to load again. I probably should have asked you about this, but I didn't want to bother you thinking that for some reason it was supposed to work this way (e.g. stopped means stopped with the possible chance of restarting in the near future, so the Actor and ActorRef linger for some time before they are actually ejected from the Children collection). In fact one way I work around this is indeed to handle messages that are received by deadLetters by registering a listener, dynamically reloading the aggregate-actor, and then dispatching the message to the newly loaded aggregate-actor.
The fact that the name is not immediately available is a bit puzzling to me, because the same name must be reused during a supervision recovery.
Regarding race conditions, I don't think this would necessarily be a problem. It's not the responsibility of any given client to stop an aggregate-actor. It just happens during a LRU clean up, and I want the sort of "page fault" response to sending an ActorRef a message that is received by deadLetters that causes the actor to reload.
Thanks Roland. I will drop the subtopic, especially since something seemed to learn recently that my posts are okay :) And I don't think badly of any of you. If I didn't have very high regard for you guys I wouldn't be working on this stuff in the first place. So I apologize that my terminology was taken another way.
I have read those docs already, but I may have missed a finer point. Actually I think I did read that note about not being able to reuse an actor's name until a Terminated message is received. That's why I took the route of tweaking the name a little so I could almost reuse the same name. (Basically I am encoding the actor's name in a few different ways so that the grid add-ons can deal with reloading actors just in time.)
I have several concerns with sending through a parent. For one thing, depending on the policy used as a parent, the aggregates would have less memory to consume in a single VM. My goal is to maintain as many aggregates in memory as possible. If, for example, there was a 1:1 parent to child then it obviously halves the memory for aggregates. I am pretty sure that's not what you are suggesting, however. Otherwise, the parent of the aggregate becomes roughly like an application service, and I am purposely eliminating those form he architecture. Besides, we could still fall into the same problems you describe of losing messages if the parent goes away.
I thought for sure that as soon as an actor is stopped that any message sent to it would go to deadLetters. Why would this ever fail to be true? Why would a message ever be completely lost, as in "poof" it's gone?
Actually what I have wanted to discuss with you is some way to create a user-defined ActorRef, much like LocalActorRef or InternalActorRef. I think being able to create, for example, a GridActorRef could be a cure for most of the issues I have previously had to address. Essentially the GridActorRef could track termination and auto-reloading. In that case clients could use Akka in the simplest way and not have to deal with special routing policies.
Justin,
Sorry if I end up reciting things obvious to you here, but I'm going to explain my general opinions about combining domain driven design, event sourcing and the actor model. Vaughn, I'm probably going to be covering plenty of stuff you've already formulated and shared with others! However, I wanted to share my own raw thoughts that have not specifically influenced by anyone else's thinking.
As Vaughn has clearly worked out quicker than the rest of us :-) it seems like the actor model just fits very well with domain driven design. It feels quite natural to me to consider an actor analogous to an aggregate root (in DDD speak). So, rather than just seeing an actor as a mediator sitting in front of a database, you see the actor conceptually as the entity. By incorporating event-sourcing, the actor works on the basis of processing a command (representing some action) and outputting one or many events that represent the result of processing that command. At all times the actor encapsulates its current state, which can simply be seen as the result of a series of ordered events applied to it.
Initially, it's actually quite helpful to ignore persistence requirements altogether and just rely on the state within the actor - in this way you don't allow persistence concerns to influence the way you design your domain - I often find that domain models end up messy because, despite attempts to avoid doing so, persistence concerns end up, in one form or another, leaking into the business logic. Any approach to building a domain layer that can genuinely remove the need to consider persistence technologies is an attractive proposition in my mind!
By following an event-sourcing approach, persistence becomes no more complex than just persisting the events - that the actor produces - in an event store (journal). Given that events represent an immutable history of state changes, the journal can be append only and that's pretty exciting from a performance perspective. This is something that can quite clearly be bolted on once you've already put together a working in-memory only version of your domain - the actors themselves can be completely agnostic to the existence of the persistence mechanism. This is where akka-persistence comes in - it works on the following basis:
1) Actor receives command2) Actor processes command (applies business logic) and produces events that represent results of processing3) Events are persisted to journal4) Events are applied to actor so it can update it's internal state
akka-persistence pretty much deals with everything other than the command handling step, which obviously represents your custom business logic - akka is not quite good enough (yet) to do that bit ;-)
Step 4) is quite important - it's key that internal state is only applied once you're sure events have been persisted to the journal. Also, by separating this step, it serves the additional purpose of allowing events in the journal to be replayed onto a "green" instance of the actor such to bring it's internal state back up to current. And this is exactly what would be required for what we've discussed previously with regard to actors being reloaded into the cluster having been cleared out (due to idleness). akka-persistence also has support for "snapshots" which allow you to take periodic snapshots of current state to be used as a performance optimisation when replaying events.
So, to sum up, the actor model just "fits" with domain driven design and event sourcing. It seems to deal with a majority of the pain points experienced when building a domain layer using more traditional CRUD techniques. It's pretty exciting to me how natural this design feels without any need to consider using an ORM ;-)
Hope I've not written a complete load of un-intelligible trash :-)
On Thursday, 24 October 2013 06:25:52 UTC-7, Justin du coeur wrote:On Wed, Oct 23, 2013 at 11:42 PM, Andrew Easter <andrew...@gmail.com> wrote:
Are you including event sourcing in the scope of this?
Like Roland says, I definitely foresee this overall approach becoming much more commonplace, especially with akka-persistence on the horizon.
I haven't looked much into event sourcing or akka-persistence in this context yet (I only realized the existence of akka-persistence a short while ago). I'm not sure whether it's appropriate for my particular problem or not -- I'm building what amounts to a database, and the details of the persistence strategy matter a lot -- but I'm not ruling it out yet. Some aspects of what I'm hearing about akka-persistence, such as the emphasis on journaling, are things that I'd already been planning on building myself. So I'm going to need to understand this stuff better.
(I get the impression that I should maybe follow the akka-dev list, for a better sense of what's coming down the pike?)
In general, there's an interesting philosophical issue here that I'm going to need to ponder. I've been thinking of my Spaces as fundamentally *database* structures, that happen to use an Actor as their front end mediating communication. So it never occurred to me to even think about akka-persistence as relevant, since I don't really think of the Actor per se as the thing I'm persisting. But it's possible that the difference isn't actually meaningful. I'll need a better understanding of akka-persistence to know -- is there a good overview of the plan?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
-- Martin Krasser blog: http://krasserm.blogspot.com code: http://github.com/krasserm twitter: http://twitter.com/mrt1nz
Okay, this is what I've been talking about: https://vaughnvernon.co/?p=770
Vaughn
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
If you haven't yet watched this presentation, I suggest doing so: http://skillsmatter.com/podcast/design-architecture/vaughn-vernon
It all includes the use of CQRS and what I'd call "message sourcing" as opposed to "event sourcing." I gave a much more complete presentation at the recent NYC DDD eXchange, but I think that was not recorded, or at least not posted. However, you should understand that both CQRS and Event Sourcing (or Message Sourcing) are orthogonal to DDD. I discussion of explicitness has nothing to do with incorporating CQRS/ES. Yet, these are both mostly necessary patterns when using Actor Model. I'd say that you need to look at Martin's work on akka-persistence, (and/or Eventsourced) as it is the most complete expression of this in Scala and Akka to date. While I basically agree I think there are a few differences in our approaches. Once I get the whole thing put together perhaps Martin would like to consider what I have to say.
I imagine that he's got too much to deal with now anyway, so the timing will probably be better in a month or two.
Vaughn
On Friday, October 25, 2013 8:55:36 PM UTC-6, Andrew Easter wrote:Sorry, pressed send too early!!!========================
Vaughn,
Whilst I totally understand the case you are making, I'm still not really sure that I fully share your concerns with regard to lack of explicitness in some of the proposals in this thread. We've not really talked about CQRS explicitly in this thread, but I was under the impression (maybe wrongly) that the typically async nature of command dispatch fits quite nicely with the idea of just firing off a command and trusting it will be processed by the correct aggregate. On the other hand, I suppose one could reasonably argue that the lack of explicitness in that mechanism is not something one should be content with.
I do get the argument that this approach exposes the presence of application services to the client, but I guess I don't really see this as such a smell as you do!
Thanks for an interesting read - it does seem like you are on a good path with your prototype.
Andrew
On Friday, 25 October 2013 19:49:57 UTC-7, Andrew Easter wrote:Vaughn,
Whilst I totally understand the case you arI'm still not really sure that I fully share your concerns with regard to lack of explicitness in some of proposals in this thread. We've not really talked about CQRS explicitly in this thread, but I was under the impression (maybe wrongly) that the typically async nature of command dispatch fits quite nicely with the idea of just firing off a command and trusting it will be processed by the correct aggregate.
On Friday, 25 October 2013 14:20:28 UTC-7, Vaughn Vernon wrote:
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
-- Martin Krasser blog: http://krasserm.blogspot.com
val model = DomainModel("my-domain") {Order,Customer,Payment}
As Vaughn has clearly worked out quicker than the rest of us :-) it seems like the actor model just fits very well with domain driven design. It feels quite natural to me to consider an actor analogous to an aggregate root (in DDD speak). So, rather than just seeing an actor as a mediator sitting in front of a database, you see the actor conceptually as the entity. By incorporating event-sourcing, the actor works on the basis of processing a command (representing some action) and outputting one or many events that represent the result of processing that command. At all times the actor encapsulates its current state, which can simply be seen as the result of a series of ordered events applied to it.
Initially, it's actually quite helpful to ignore persistence requirements altogether and just rely on the state within the actor - in this way you don't allow persistence concerns to influence the way you design your domain - I often find that domain models end up messy because, despite attempts to avoid doing so, persistence concerns end up, in one form or another, leaking into the business logic. Any approach to building a domain layer that can genuinely remove the need to consider persistence technologies is an attractive proposition in my mind!
Hi Andrew,On Mon, Oct 7, 2013 at 2:54 PM, Andrew Easter <andrew...@gmail.com> wrote:
I'm currently doing some prototyping using Akka to implement the Domain Driven Design (DDD), CQRS and Event Sourcing patterns. I'm not sure whether I'm barking up the wrong tree, but my general preference would for the system to work something like this:
- Some command comes in to modify a given Aggregate Root (AR) entity
- If an Actor representing the AR is not already running in the system, create it _atomically_ (i.e. make sure you never have more than one Actor representing a specific entity)
- Actors should be removed after a period of idleness. This will avoid keeping actors around for entities with low interaction rates, but ensure 'hot' entities are kept in memory for performance (starting a new actor requires loading events from an event store in order to restore the memory image representing the entity state)
That is a sane design. You probably also want to look at akka-persistence.Actors don't consume much more than memory when they are idle, but that can be a good enough reason to prune them.I'm wondering if there are any best practices with regard to creating actors atomically whilst avoiding any performance overload during the lookup process - i.e. if an actor is already running, you'd ideally not incur any sort of lookup related performance penalty.That is best handled by a parent actor. The entities can stop themselves when idle (e.g. by using ReceiveTimeout), and that will automatically remove them from the parent in a safe way.
Thanks!
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
I'm intending to work on a more complete example that incorporates akka-persistence, timeouts etc.
Might turn out to be a pretty useful Typesafe Activator template in time :-)
Andrew
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
- Some command comes in to modify a given Aggregate Root (AR) entity
- If an Actor representing the AR is not already running in the system, create it _atomically_ (i.e. make sure you never have more than one Actor representing a specific entity)
- Actors should be removed after a period of idleness. This will avoid keeping actors around for entities with low interaction rates, but ensure 'hot' entities are kept in memory for performance (starting a new actor requires loading events from an event store in order to restore the memory image representing the entity state)
I'm wondering if there are any best practices with regard to creating actors atomically whilst avoiding any performance overload during the lookup process - i.e. if an actor is already running, you'd ideally not incur any sort of lookup related performance penalty. This applies in a clustered environment as well as when running in a single JVM.I have seen documentation on the Cluster Singleton Pattern, but my interpretation of this was that each ClusterSingletonManager would need to know up front what actors needed to be singletons. In my suggested design, you only create the Aggregate Root actors on the fly and thus do not know up front.Would be interested in opinions on this.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.
Andrew