Is this insane?

Allen Gilliland allen.gilliland at sun.com
Mon Dec 4 01:17:42 UTC 2006



mike wrote:
> I'm looking at strategies to cache some data, and I just want to run
> this by people to see how they use it or if what I'm thinking is just
> insanity.
> 
> Does it sound crazy to have 30-50 gets per page load? I'm thinking of
> caching each row in a database basically treating it as an object
> based on the primary key. Then fetching the cached information based
> on a list of IDs (basically saving a query of SELECT allthedata FROM
> allthetables WHERE PK IN(key1,key2,key3))

I don't really think that 30-50 gets per page load is a problem, 
particularly if they are gets from a cache, but I would be more worried 
about the application infrastructure you are talking about in order to 
design that solution.

Perhaps I don't understand the problem well enough, but I don't see why 
you want to replicate your database in your cache.  Your database should 
be offering you excellent performance when doing single row lookups by a 
primary key, that's what the database is designed for.

-- Allen


> 
> I mean, not all pages will have this - but pages with lists of data
> would; and each item in the list would basically be a row of precached
> data in the database; it would have to be sorted/ordered and such
> differently, so it wouldn't necessarily make sense to just cache the
> entire result set as-is, I'm thinking row-based would be the most
> effective way.
> 
> Thoughts?
> 
> Thanks,
> mike


More information about the memcached mailing list