You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by siva <si...@bizruntime.com> on 2019/09/23 15:27:34 UTC

How to update QueryEntities property of CacheConfiguration for existing/already created cache

Hi,
we have implemented .net core server with 3rd party and native persistence
enabled & .net core thick client to create caches and thinclient to perform
crud/sql operations to the grid from multiple applications

we are creating single cache for multiple models classes  and working
fine.But problem is if we want to add new model class which should be
queriable as old model classes to the existing cache since we are
registering QueryEntities at the time of create cache.

*so, how to update QueryEntities property of CacheConfiguration with New
QueryEntity  Model class for existing/already created cache?*


Created Cache by using bellow obejct:

    

I have tried like 

      
	 
	 But still not effected ,QueryEntities property still list of two
QueryEntity classes only



Thanks
siva



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
*do you have the same table set for every tenant?*
Yes right now,we have same table schema for each tenant







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Too many things come into play here, the only way to know is to test both
approaches on your use case.
By the way, do you have the same table set for every tenant?
It may be beneficial to group caches not by tenant, but by data size and
type.



On Thu, Sep 26, 2019 at 12:56 PM siva <si...@bizruntime.com> wrote:

> Hi Pavel,
>
> I have some queries related to cache groups ,if you help it will be useful
> for us.
>
>
> *instead of one cache per company, use one cache group per company.
> *
> 1.What is the performance impact
>  =>Is there any number of cache group limitations?
>     here cachegroups proportional to tenants
>
> 2.What If we have only cluster of 3 nodes(each node 16cpu and 56GB RAM with
> ssd) handling  20 cachegroups with each cache group contains 120 caches(i.e
> 2.4k caches aprox)
>
>
> *That said, they might impact the performance of read operations and
> indexes
> lookups
> *is it reasonable or drastically decrease? Since Our application is for
> both
> read and create/update intensive (before create or update we should
> query/read data from different  tables)
>
>
>
>
> Thanks
> siva
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
Hi Pavel,

I have some queries related to cache groups ,if you help it will be useful
for us.


*instead of one cache per company, use one cache group per company.
*
1.What is the performance impact 
 =>Is there any number of cache group limitations?
    here cachegroups proportional to tenants

2.What If we have only cluster of 3 nodes(each node 16cpu and 56GB RAM with
ssd) handling  20 cachegroups with each cache group contains 120 caches(i.e
2.4k caches aprox)


*That said, they might impact the performance of read operations and indexes
lookups
*is it reasonable or drastically decrease? Since Our application is for both
read and create/update intensive (before create or update we should
query/read data from different  tables)




Thanks
siva



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
Thanks Pavel for helping,Ok i do go through  documentation for cache groups
and will check  once







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Turns out we can't create multiple tables per cache with SQL DDL, this is a
design limitation.
The error message is misleading, I'll file a ticket to fix it.

So again, I would advise to use one table per cache approach.
To reduce the overhead of creating 1000s of caches, you can leverage Cache
Groups feature:
https://apacheignite.readme.io/docs/cache-groups

So instead of one cache per company, use one cache group per company.

Does this work for you?


On Wed, Sep 25, 2019 at 10:42 AM Pavel Tupitsyn <pt...@apache.org>
wrote:

> Yes, you are correct, now I see the problem too. Let me investigate it a
> bit and get back to you.
>
> On Wed, Sep 25, 2019 at 10:37 AM siva <si...@bizruntime.com> wrote:
>
>> Hi Pavel,
>> '
>>
>> actually Lecturer table not exists since the cache created with Student
>> query entity only ,if we try to create another table (lets say
>> HODepartment)
>> with already created cache also same exception is throwing .
>>
>>
>>
>>
>> Thanks
>> siva
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Yes, you are correct, now I see the problem too. Let me investigate it a
bit and get back to you.

On Wed, Sep 25, 2019 at 10:37 AM siva <si...@bizruntime.com> wrote:

> Hi Pavel,
> '
>
> actually Lecturer table not exists since the cache created with Student
> query entity only ,if we try to create another table (lets say
> HODepartment)
> with already created cache also same exception is throwing .
>
>
>
>
> Thanks
> siva
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
Hi Pavel,
'

actually Lecturer table not exists since the cache created with Student
query entity only ,if we try to create another table (lets say HODepartment)
with already created cache also same exception is throwing .




Thanks
siva



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Ok, so Lecturer table already exists when you try to create it again.
Just run DROP TABLE IF EXISTS Lecturer before trying to create it.

On Tue, Sep 24, 2019 at 12:26 PM siva <si...@bizruntime.com> wrote:

> Hi Pavel,
>
> I have attached github link for the reproducer of above exception
>
>
> https://github.com/cvakarna/ignitereproducer
> <https://github.com/cvakarna/ignitereproducer>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
Hi Pavel,

I have attached github link for the reproducer of above exception 


https://github.com/cvakarna/ignitereproducer
<https://github.com/cvakarna/ignitereproducer>  





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Can you please attach a reproducer for that exception?

On Tue, Sep 24, 2019 at 8:46 AM siva <si...@bizruntime.com> wrote:

> Thanks *Pavel *for the reply
>
> our application is  multi company application ,so each company instance
> have
> more than 100 tables.so that we are creating single cache for each company
> instance containing lot  entity classes as well as it thirdparty enable
> with
> native persistence.
>
>
> *You can manipulate SQL tables for existing caches with DML,
> *yes,we are using DML for if any new field added/removed to the
> entity/model
> class by using sqlline.
>
> For Updating New Model/Entity class is  visible to sql query only problem
> to
> us now,
> i have tried like this also
> ,newly entity class record inserted into ignite cache(name
> company1),working
> for crud operations with key,for visible to sql api , tried to create table
> with same entity/model class name  with specified cachename as company1
> which is already created.but exception occured  as table already exists
>
> java.sql.SQLException: Table already exists: CARSALES
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by siva <si...@bizruntime.com>.
Thanks *Pavel *for the reply

our application is  multi company application ,so each company instance have
more than 100 tables.so that we are creating single cache for each company
instance containing lot  entity classes as well as it thirdparty enable with
native persistence.


*You can manipulate SQL tables for existing caches with DML,
*yes,we are using DML for if any new field added/removed to the entity/model
class by using sqlline.

For Updating New Model/Entity class is  visible to sql query only problem to
us now,
i have tried like this also 
,newly entity class record inserted into ignite cache(name company1),working
for crud operations with key,for visible to sql api , tried to create table
with same entity/model class name  with specified cachename as company1
which is already created.but exception occured  as table already exists 

java.sql.SQLException: Table already exists: CARSALES



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to update QueryEntities property of CacheConfiguration for existing/already created cache

Posted by Pavel Tupitsyn <pt...@apache.org>.
Hi siva, modifying QueryEntity configuration of existing cache is not
possible.
Also, having multiple model classes per cache is not recommended.
The recommended way is to create a new cache for every new model/entity,
and have one QueryEntity per cache.
Note that you can achieve all the same queries with multiple caches, like
joins across many entities and so on.

You can manipulate SQL tables for existing caches with DML, though, which
is almost what you ask for:
https://apacheignite-sql.readme.io/docs/schemas
https://apacheignite-sql.readme.io/docs/create-table

Thanks,
Pavel

On Mon, Sep 23, 2019 at 6:27 PM siva <si...@bizruntime.com> wrote:

> Hi,
> we have implemented .net core server with 3rd party and native persistence
> enabled & .net core thick client to create caches and thinclient to perform
> crud/sql operations to the grid from multiple applications
>
> we are creating single cache for multiple models classes  and working
> fine.But problem is if we want to add new model class which should be
> queriable as old model classes to the existing cache since we are
> registering QueryEntities at the time of create cache.
>
> *so, how to update QueryEntities property of CacheConfiguration with New
> QueryEntity  Model class for existing/already created cache?*
>
>
> Created Cache by using bellow obejct:
>
>
>
> I have tried like
>
>
>
>          But still not effected ,QueryEntities property still list of two
> QueryEntity classes only
>
>
>
> Thanks
> siva
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>