Why multiple QueryEntities in a CacheConfiguration?

classic Classic list List threaded Threaded
4 messages Options
vinshar vinshar
Reply | Threaded
Open this post in threaded view
|

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
Sergi Vladykin Sergi Vladykin
Reply | Threaded
Open this post in threaded view
|

Re: Why multiple QueryEntities in a CacheConfiguration?

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 <[hidden email]>:
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.

vinshar vinshar
Reply | Threaded
Open this post in threaded view
|

Re: Why multiple QueryEntities in a CacheConfiguration?

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
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|

Re: Why multiple QueryEntities in a CacheConfiguration?

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 <[hidden email]> 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.