Hi John,

I would use Akka Cluster and a cluster aware consistent hashing group router
<http://doc.akka.io/docs/akka/2.3.9/scala/cluster-usage.html#Router_with_Group_of_Routees>
for this.

Cheers,
Patrik

On Thu, Mar 26, 2015 at 10:11 AM, <[email protected]> wrote:

> Hi and Hello!
> This is the first time I am posting and I am relative new to akka.
>
> I have written a single webapp which answers with java akka complicated
> search queries.
>
> The akka system needs to  precompute a lot of data based on the user
> asking the query
> so that it can serve subsequent queries for this user from its cache.
>
> I now want to load-balance this webapp so that several instances of the
> included akka system will be running.
>
> Now If a user issues a query on a server having not precomputed the user
> data I want this server to  ask the other akka systems to fullfill the
> query.
>
> In pseudo code I would do this.
>
> 1) On each server  a register  remote SerachActora for all servers.
>
> 2) when a query comes in look up locally if the data is precomputed. If
> "yes" serve the query locally and end the request.
>
> 3) If "no" ask the other remote SearchActors if they have precomputed
> data. If any has,  forward the query to the remote SearchActor (maybe store
> a mapping between user_id and SearchActor for future queries)
>
> 4) if none has data pre-compute and then answer the query locally.
>
> Is this the right way to go? Am I on the right path?
> Can  any of akka out-of-the box   components (routers) help me to
> implement the pseudo-code?
>
> Many Greetings
> John
>
> --
> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to