Data structure best practice

Shlomi Marco shlomi at corp.mocospace.com
Sun Feb 10 14:43:33 UTC 2008


Hey all.

I have a general question I've been wanted to get your take on:
How is your cache is designed? what directed you when designing it the
way you did?

I usually read about ppl caching user profile or things alike, which
is trivial enough,
but what would you do in the following scenario:
You have a user image for example.
a user may have 0-N images.
will you store a list of his image items? or a list with integers, and
a "flat" (or should I say normalized) view of the entire images in the
system, and do two gets? (one to get the list, and one to getMulti to
the subset)

We're tackling this store the entire objects list vs. store a
"normalize" view of the database question quite a lot.
what if the list is updated frequently? what if it is updated from
different sources (sync becomes a prob)? how do yo handle
cache-on-write (caching when data is submited to the DB not only when
it is fetched)? and so many other questions.

Wanted to hear some about your cache design. what do you store, for
what purpose, what things directed you when designing your application
caching and so on.

Thanks.


More information about the memcached mailing list