Redundancy is not the only reason for having multiple servers. Another common usage for multiple servers if if the data you want to cache won't fit on one server, then you can shard the data across multiple servers. At Facebook, a front-end cluster will have hundreds to thousands of cache servers with the data split across them in this way. We achieve redundancy by having multiple clusters, each with a similar number of memcached machines.
Cheers, ~Ryan On Wed, Jan 14, 2015 at 6:19 PM, Les Mikesell <[email protected]> wrote: > On Wed, Jan 14, 2015 at 8:01 PM, gunna <[email protected]> wrote: > > I'm doing a large amount of reading on the subject but had a question > about > > something. Firstly I believe while you can have an array or memcached > > server they do not replicate. If they don't replicate then what is the > > reason you would have an array? Is it purely for redundancy? What > happens > > if a query is run on server 1 and loaded into memcahed but on server 2 > that > > query is not as current as server 1. If server 1 fails and you go to > server > > 2 the query will be in cache but be stale? > > > > You use multiple servers so you still have some running in case one or > a few fail. You can either use a client hashing strategy that simply > fails and pulls from the persistent database for the percentage of > servers that are down, or you can use one that rebalances across the > remaining servers. When you cache something you set how long that > value is allowed to be used. Even in the rare case of rebalancing and > servers going in and out of the cluster such that a client queries a > server that does not have the latest value, it still won't return > something older than the time you set as ok to reuse it. > > -- > Les Mikesell > [email protected] > > -- > > --- > 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. > -- --- 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.
