How Facebook deals with memcache consistency in multiple datacenters
1–10 of 21 posts
Re: How Facebook deals with memcache consistency in multiple datacenters
#2Re: How Facebook deals with memcache consistency in multiple datacenters
#3note to self: don't start companies that require multiple synchronized data centers. :-)
Basically, the only change that needs to be done is that you have MySQL trigger the delete from memcached on replication. All your slave database gets an updated record for you, saves it in its tables and then hits memcached with a delete command for that key. While it does mean diving into the MySQL code, when you get to the size at which you need such a feature, you can just hire a MySQL expert.
Re: How Facebook deals with memcache consistency in multiple datacenters
#4Nonetheless, I can appreciate how a simple approach solves the problem. If these are the most dramatic scaling issues that facebook faces, then this provides strong support to the argument that you shouldn't focus too much on scaling and optimization when first building your site. There are probably better uses of your early time.
Re: How Facebook deals with memcache consistency in multiple datacenters
#5Interesting use of the 20-second cookie. What happens when they scale to data centers in Europe, Asia, and South America? Does it become a arbitrary-second cookie depending on where the user is? Nonetheless, I can appreciate how a simple approach solves the problem. If these are the most dramatic scaling issues that facebook faces, then this provides strong support to the argument that you shouldn't focus too much on…
Re: How Facebook deals with memcache consistency in multiple datacenters
#6I'll have to look through the code one day and see why this makes no sense.
Re: How Facebook deals with memcache consistency in multiple datacenters
#7When you issue a delete you can specify "the amount of time the client wishes the server to refuse 'add' and 'replace' commands"
Maybe they couldn't afford to increase the read load so much but this seems easier than rewriting mysql's replication engine.
Re: How Facebook deals with memcache consistency in multiple datacenters
#8Re: How Facebook deals with memcache consistency in multiple datacenters
#9There's another easier way built into memcached: When you issue a delete you can specify "the amount of time the client wishes the server to refuse 'add' and 'replace' commands" Maybe they couldn't afford to increase the read load so much but this seems easier than rewriting mysql's replication engine.
Re: How Facebook deals with memcache consistency in multiple datacenters
#10note to self: don't start companies that require multiple synchronized data centers. :-)