Hacker News new | past | comments | ask | show | jobs | submit login
Brian Aker explains Memcached (oreilly.com)
40 points by gulbrandr on April 6, 2011 | hide | past | favorite | 5 comments



Pretty basic overview and not very techy, but the last paragraph is worth the read:

"A question I'll often hear is, "How do I dump the data back out of Memcached?" If you're asking that question it usually means you're not thinking about Memcached correctly."


Right. And then he doesn't explain what the right way is.


The right way doesn't involving asking this question because you shouldn't be putting anything in memcached that you can't reconstruct from a canonical source. Here's what you do with memcached:

Find places where a result set or computed value takes 500 milliseconds to get out of the database (or to compute in your expensive Apache worker that could be setting up for a new request instead). Wrap the calls that get these values in a caching layer that first polls memcached to see if the result is there, gets the data from the database if it isn't, and then stores it in memcached before returning it. There are plenty of libraries that will just about automate this for you -- you call the fetcher function with the cache key and a callback to use in the event it isn't there, and it does the right thing.


"doesn't involving". That'll teach me to comment on HN at 8 AM.


Great, that's what was missing. Thanks for writing the end of the article!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: