You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by vinshar <vi...@gmail.com> on 2016/01/28 19:02:33 UTC

Why multiple QueryEntities in a CacheConfiguration?

Hi,

We can specify multiple QueryEntity for each CacheConfigurartion. Is there
any case where this is required except multiple type of keys and values in
same cache?

Regards,
Vinay Sharma



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Why-multiple-QueryEntities-in-a-CacheConfiguration-tp2761.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Why multiple QueryEntities in a CacheConfiguration?

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Hi Vinay,

It is not recommend only from generics stand point. Imagine simply using a
HashMap in which you store values of different types. You would not be able
to preserve the type safety with generics in that case.

Other than that, there is no limitation in Ignite internally. Feel free to
store multiple types in the same cache if your use case calls for it.

D.

On Thu, Jan 28, 2016 at 11:23 AM, vinshar <vi...@gmail.com> wrote:

> Hi Sergi,
>
> This is not recommended because of performance and best practices point of
> view or will this break something at implementation level like some
> particular queries wont work etc.
>
> Another reason just struck my mind. Multiple QueryEntities may also be
> helpful in case like dynamic cache configurations where same configuration
> will be used to create multiple caches where each cache may store same type
> keys and same type values.
>
> Regards,
> Vinay
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Why-multiple-QueryEntities-in-a-CacheConfiguration-tp2761p2763.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Why multiple QueryEntities in a CacheConfiguration?

Posted by vinshar <vi...@gmail.com>.
Hi Sergi,

This is not recommended because of performance and best practices point of
view or will this break something at implementation level like some
particular queries wont work etc.

Another reason just struck my mind. Multiple QueryEntities may also be
helpful in case like dynamic cache configurations where same configuration
will be used to create multiple caches where each cache may store same type
keys and same type values.

Regards,
Vinay



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Why-multiple-QueryEntities-in-a-CacheConfiguration-tp2761p2763.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Why multiple QueryEntities in a CacheConfiguration?

Posted by Sergi Vladykin <se...@gmail.com>.
Yes, this is exactly to be able to store multiple types in the same cache.
Though it is not a recommended way, usually it is preferable to store one
type per cache.

Sergi

2016-01-28 21:02 GMT+03:00 vinshar <vi...@gmail.com>:

> Hi,
>
> We can specify multiple QueryEntity for each CacheConfigurartion. Is there
> any case where this is required except multiple type of keys and values in
> same cache?
>
> Regards,
> Vinay Sharma
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Why-multiple-QueryEntities-in-a-CacheConfiguration-tp2761.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>