tenwit wrote:
Fair enough.
I've never seen a best practice being metioned anywhere around here, but I would imagine that it depends on how you're using the cache. If you're intending to do some cache management (specifically, you want to be able to evict chunks of cache based on age), then you'll probably want to follow java's model: eden, survivor1, survivor2, old. If you don't want that functionality, then you're probably using the cache to assist with LRU or MRU algorithms, so division by logical grouping would be best. If you're not "manually" using the cache at all, and are only setting it up to allow hibernate to make use of it, then you shouldn't have to worry about dividing it up.
Well, that does give me some ideas. I very rarely will need to deal with the cache manually and need it mostly for writing. For regular traffic areas, I will use a default cache, unless I start getting errors. For the higher traffic input areas (promotions and the like), I will use a named cache for each, size based on the size of the objects and the expected traffic. Since the higher areas are usually input only, the time to live for these objects will be small (a minute or less).
Who knows, perhaps this discussion will be the start of caching best practices.