Simple way to memcache (almost) all database queries

nosql:

I’d probably argue that’s way too simple (and probably not so useful). What I’d do is:

  1. make sure that I don’t have duplicates in the cache

    Supporting this behavior is not so complex: a query cache will just store the keys of the results and use the multi_get for fetching these. In case objects are missing from the cache then you go on an execute the query making sure that this time you are caching each result object and the set of keys.

  2. look into using a key-value store

    This would definitely be more fun, not to mention that it might give you extremely good results. Take for example Redis, which is sometimes called memcached on steroids and check this benchmark results to get an idea of the performance.

This was posted 2 years ago. It has 1 notes.
Tags:  php  memcached 
  1. infynyxx reblogged this from nosql
  2. nosql posted this

Hi, I'm Prajwal and this is my personal blog mainly focusing on some random things directy or indirectly affecting my life with some extra touch on finance and economy. I also have a tech blog, kind of my professional blog. I work @ collegehumor.com Sailthru, a NYC based startup as a back end developer.

I grew up in Kathmandu and currently live in Queens, NY (NYC).


Copyright Prajwal Tuladhar.

Some Rights Reserved