how to implement the state migration with consistent hashing routing

40 views
Skip to first unread message

Nan Zhu

unread,
Nov 21, 2014, 7:10:42 AM11/21/14
to akka...@googlegroups.com
Hi, all

I have a question about consistent hashing routing in akka

in my system, all actors are stateful, specifically:

all the actor maintains one or more lists as their state, the message is indexed by a key. The router then forward the message according to the key to one of the actors which in turn save the message to the corresponding list (i.e. the list is bind with a key)...

when a new node is added to the cluster, the router will update the hash function, and the future messages with the keys falling in the certain range will be forwarded to this new node....

The problem, I also need to query the saved message...according to my understanding on the Akka implementation, the messages saved in the old routee will not be automatically migrated to the new joined one, so my query will only get partial result

is that true? if yes, how to implement this function? 

it seems that cluster-sharding can do this naturally, but just curious about if we can do with consistent hashing schema

Thanks

Nan

Nan Zhu

unread,
Nov 21, 2014, 7:53:03 AM11/21/14
to akka...@googlegroups.com
the only way is to replicate what cluster -sharding does?

use a singleton instance to maintain everything? (but that is contrast with the discipline of DHT which is essentially a de-centralized design?)

Best,

Nan

Patrik Nordwall

unread,
Nov 22, 2014, 11:19:59 AM11/22/14
to akka...@googlegroups.com
Hi Nan,

Wouldn't cluster sharding be used instead of a consistent hashing router?
I'm not sure I understand your question.

Regards,
Patrik

 

Thanks

Nan

--
>>>>>>>>>> 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 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/d/optout.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Nan Zhu

unread,
Nov 22, 2014, 1:08:21 PM11/22/14
to akka...@googlegroups.com
yes, I have refactored system as using cluster sharding now, 

just curious about if we can implement state migration with consistent hashing 

Best,
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/a7mw5bCUh8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.

Patrik Nordwall

unread,
Nov 23, 2014, 1:38:49 PM11/23/14
to akka...@googlegroups.com
On Sat, Nov 22, 2014 at 7:23 PM, Nan Zhu <zhunan...@gmail.com> wrote:
yes, I have refactored system as using cluster sharding now, 

just curious about if we can implement state migration with consistent hashing 

No, consistent hasing doesn't solve actor state migration, by itself. It's easiest to implement state migration by making the actors persistent.

/Patrik
Reply all
Reply to author
Forward
0 new messages