On Jan 31, 2014, at 7:30 AM, Radim Vansa <rvansa(a)redhat.com> wrote:
On 01/30/2014 08:51 PM, Mircea Markus wrote:
> On Jan 30, 2014, at 9:42 AM, Galder ZamarreƱo <galder(a)redhat.com> wrote:
>
>> On Jan 21, 2014, at 11:52 PM, Mircea Markus <mmarkus(a)redhat.com> wrote:
>>
>>> On Jan 15, 2014, at 1:42 PM, Emmanuel Bernard <emmanuel(a)hibernate.org>
wrote:
>>>
>>>> By the way, people looking for that feature are also asking for a unified
Cache API accessing these several caches right? Otherwise I am not fully understanding why
they ask for a unified query.
>>>> Do you have written detailed use cases somewhere for me to better
understand what is really requested?
>>> IMO from a user perspective, being able to run queries spreading several
caches makes the programming simplifies the programming model: each cache corresponding to
a single entity type, with potentially different configuration.
>> Not sure if it simplifies things TBH if the configuration is the same. IMO, it
just adds clutter.
> Not sure I follow: having a cache that contains both Cars and Persons sound more
cluttering to me. I think it's cumbersome to write any kind of querying with an
heterogenous cache, e.g. Map/Reduce tasks that need to count all the green Cars would
need to be aware of Persons and ignore them. Not only it is harder to write, but
discourages code reuse and makes it hard to maintain (if you'll add Pets in the same
cache in future you need to update the M/R code as well). And of course there are also
different cache-based configuration options that are not immediately obvious (at design
time) but will be in the future (there are more Persons than Cars, they live longer/expiry
etc): mixing everything together in the same cache from the begging is a design decision
that might bite you in the future.
>
> The way I see it - and very curious to see your opinion on this - following an
database analogy, the CacheManager corresponds to an Database and the Cache to a Table.
Hence my thought that queries spreading multiple caches are both useful and needed (same
as query spreading over multiple tables).
I would be all hands for this approach, but there's still one thing
where it makes sense - Animal cache with Cats and Dogs.
Not a good idea to keep cats and dogs together :-)
Would it be a problem iff the user works with Animals only?
Cheers,
--
Mircea Markus
Infinispan lead (
www.infinispan.org)