Thanks alot for your quick reply. What am confused about and think that is contradicting, is the first point mentioned that memcached server as separated and didn't know anything about each other, which means, if there is a data replicated on 2 server, and each have it own memcached, there would be no kind of keeping the data consistent between them, Am I right?
If yes, is this a good practice, or for all my clusters I should have one and only one memcached for'em all? Thanks, Karim On Friday, 17 October 2014 20:50:56 UTC+2, LesMikesell wrote: > > On Fri, Oct 17, 2014 at 1:23 PM, Karim Tawfik <[email protected] > <javascript:>> wrote: > > Hi, > > > > I am new to memcached, and try to introduce it on our company as a > caching > > layer, but there is a question came up to my mind, how memcached handle > the > > consistency of data to all are the same in all clusters. > > > > For example: > > say I have 2 clusters, each have memcached is installed on it, and > clients > > started to send requests (e.g.updating some data), how the other > memcached > > server would know about such update if it is already caching an old > version > > before it got updated. > > > > I am asking this question as i read 2 contradicting statements on the > > website, which are: > > > > Under ==> https://code.google.com/p/memcached/wiki/NewOverview, > section. > > > > Servers are Disconnected From Each Other : Memcached servers are > generally > > unaware of each other. There is no crosstalk, no syncronization, no > > broadcasting > > > > Under ==> https://code.google.com/p/memcached/wiki/TutorialCachingStory > > > > So again, he takes keys that the Programmer uses and looks for them on > his > > memcached servers. 'get this_key' 'get that_key' But each time he does > this, > > he only finds each key on one memcached! Now WHY would you do this, he > > thinks? And he puzzles all night. That's silly! Don't you want the keys > to > > be on all memcacheds? > > > > "But wait", he thinks "I gave each memcached 1 gigabyte of memory, and > that > > means, in total, I can cache three gigabytes of my database, instead of > just > > ONE! Oh man, this is great," he thinks. "This'll save me a ton of cash. > Brad > > Fitzpatrick, I love your ass!" > > > > Could you please give me the clear directions, if i have incorrect view. > > What is it that you think is contradicting here? The client is > configured for a set of servers to use, computes a specific one of > them from a hash of the key, and writes an item to exactly one server. > When any client with the same configuration looks up that same key it > will do the same computation and thus target the same server. Other > keys may go to other servers. > > > The last thing is, does memcached get affected by anymeans of > replications > > between server? > > No, there is only one copy. If that server instance is down, the > client must get the data from the backing persistent storage - and > depending on the client's hashing strategy it can either continue to > fail for whatever percentage of the cache that server handles until it > comes back up, or it can rebalance the storage over the remaining > servers. > > -- > Les Mikesell > [email protected] <javascript:> > -- --- You received this message because you are subscribed to the Google Groups "memcached" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
