It's right that when you use Cluster Sharding you will not build deep actor
hierarchies. The main purpose of the hierarchy is supervision, how to deal
with failures. The entities are already managed by Cluster Sharding. You
may still add a supervisor actor between Cluster Sharding and the actual
entity actor. That could for example handle things like db connection
failures, with backoff before trying again.

I don't think the new Getting Started guide describes that aspect, but it
can be a good read anyway if you haven't read it already.
http://doc.akka.io/docs/akka/current/scala/guide/tutorial_1.html

/Patrik

On Sat, Sep 2, 2017 at 11:57 PM, Sebastian Oliveri <[email protected]>
wrote:

> I´ve read that in order for an akka based software to be well organized
> and supervised it is recommended to organize actors as a tree instead of
> having top level actors hanging from the User guardian and this is
> something I still don´t get the point. I see the point from a performance
> tip when using actorSelection() but I don´t see any other reason.
>
> I am applying DDD as the development technique modeling aggregates as
> clustered sharded persistent actors and all of them are 1 level below the
> guardian, as DDD they are not related at all but through business
> identifiers. I never used context.actorOf to create childs since from a DDD
> perspective I don´t see the need for... maybe for performing technical
> stuff like actors for migrating stuff that should take into account
> supervision strategies and so on, but for actor as domain aggregates I
> don´t get the point to build a tree hierarchy around them.
> Yet for handling aggregate business exception when invariants are violated
> actors return an akka.Failure message that maps to an exception in HTTP
> controllers, so aggregates are not supervised at all from my point of view.
>
> Since I am mapping all my DDD experience into actors a´la Vaughn Vernon is
> this OK? I read its book suggesting to even build aggregates around
> hierarchies but still don´t get the point why?
> Suppose I model my aggregates: Interviewer - Inteviewee - Interview.
> All actor instances will be below the guardian with the respective IDs as
> "guardian/shardCoordinator/..../interviewer-1" and so on...
>
> Is this OK? What are the good practices with a concrete example?
>
> Thanks,
> Sebastian.
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to