Some details needed on Distributed and Replicated mode

Topics: Developer Forum, Project Management Forum
Aug 17, 2008 at 1:59 PM
Two questions:
1) In Distributed mode - let's say we have three cache nodes - A, B & C.
    When Add is invoked - how cache defines to which node data would be added?
    How cache 'knows' to retrieve it from this specific node afterward and not from two others which don't have it?
     Probably cache node is chosen in both cases using some unique hash key for specific object being manipulated - is that right?

2) In Replicated mode - is it possible to specify that Add function should lock until data is replicated over all the nodes (or is it returns immediately and replication continues in the background)?
 
Best regards,
      Alex Pinsker
      http://alexpinsker.blogspot.com
Coordinator
Aug 17, 2008 at 3:24 PM
hi alex,

1) please check the following link for further information: 
>> In Distributed mode - let's say we have three cache nodes - A, B & C.
Disptributed Caching: http://www.sharedcache.com/cms/distributed_caching.aspx
Replicated Caching: http://www.sharedcache.com/cms/replicated_caching.aspx
>> When Add is invoked - how cache defines to which node data would be added?
>> How cache 'knows' to retrieve it from this specific node afterward and not from two others which don't have it?
>> Probably cache node is chosen in both cases using some unique hash key for specific object being manipulated - is that right?
The way we work upon distributed caching is to calculate hashcode based on your key: http://sharedcachedocu.indexus.net/html/T_MergeSystem_Indexus_WinServiceCommon_Hashing_Hash.htm
Lets say we have 3 servers then ["YourKey".GetHashCode() % 3] thats the easiest way to find your key.

2) currently you are not able to manage this within configuration but its quite easy to implement this, you add it to your close server node receive the result that data has been added and
we distribute it on the background.

hope this answers all your questions.

regards,
roni