php - How best to implement Memcached on a Ecommerce Website -


i've got large ecommerce website running lamp , wondering how best implement memcached?

  • store queries in memcached period - sounds pointless

  • store important data product information memcached , make sure proper updates can expire correctly - sounds end end solution.

  • store complex query results not change - involves lot of static code

trying overview of changes should make take best advantage of memcached.

thanks :)

i'd let users decide.

in other words rather trying second guess work best, i'd rework database queries use memcached along lines of;

  1. can memcache answer query? if - return results cache.
  2. if not 1), pull results database , write memcached next time it's in cache.
  3. ensure updates / inserts / deletes invalidate appropriate cache keys.

now given 3) might complex, i'd use factor choose queries load through cache - if it's hard and/or time consuming invalidate cache, don't cache queries start with.

because memcached automatically dump least used keys when store approaches capacity, can set never expire , allow available resources determine in cache. largely determined user behaviour (which products popular etc) , hence first comment letting users decide.

it's worth saying should ensure mysql database tuned first can easier win. query caching, checking heavy queries explain tune indexes etc, of can have greater impact.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -