Hello,
Lets suppose that we have some kind of items and these items could be rated by users. Should I store item rating and item data in different memcache keys?
Logically, we should keep rating out of main item data, because item data changes very rarely, but rating changes more often. When somebody rates the item I should invalidate only item rating key, but not whole item.
Why I'm asking this question? For example, I have 100 items per page....
- I'm getting item ids for this page = 1 memcache "query"
- I'm getting item data for each item id on page = 100 memcache "queries"
- I'm getting item rating for each item id on page = 100 memcache "queries"
Total : 201 memcache "queries"
Storing item rating together with main item data in one key we will get only 101 memcache "queries".
So, what is the best practice? I'm really worried about number of memcache "queries" per page. Or I shouldn't worry about it?
Thank you.