You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Kamal C <ka...@gmail.com> on 2016/04/27 06:02:49 UTC

Affinity Collocation

Hi all,

    In the example provided for affinity collocation [1], how the keys
 of different caches gets collocate together ?

Say, there are two caches:
1. Person cache
2. Organization cache

While inserting the elements into Person cache, I've to use either the
annotation *AffinityKeyMapped *or* AffinityKey *to collocate the data
with the organization in the same node.

My question: We are not specifying any dependency such that person
cache depends on organization cache. There can be n number of caches
with same keys as organization cache. Then, How it works?

[1] https://apacheignite.readme.io/docs/affinity-collocation

--Kamal

Re: Affinity Collocation

Posted by Kamal C <ka...@gmail.com>.
Thanks Vladimir!

On Wed, Apr 27, 2016 at 2:31 PM, Vladimir Ozerov <vo...@gridgain.com>
wrote:

> Hi,
>
> There should not be any problems with config like this because all
> Organization entries will be located on all nodes in the cluster.
>
> Vladimir.
>
> On Wed, Apr 27, 2016 at 9:47 AM, Kamal C <ka...@gmail.com> wrote:
>
>> What do you mean by cache configuration?
>>
>> If I go with the below configuration, will it create any problem ?
>>
>> Person cache                          - Partitioned, Atomic Mode
>> Organization / Company cache - Replicated, Transactional Mode
>>
>> --Kamal
>>
>> On Wed, Apr 27, 2016 at 10:46 AM, Alexey Goncharuk <
>> alexey.goncharuk@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> As long as cache configuration is the same, affinity assignment for such
>>> caches will be identical, so you do not need to explicitly specify cache
>>> dependency. On the other hand, if cache configurations do differ, it is not
>>> always possible to collocate keys properly, so for this case such a
>>> dependency also does not seem legit.
>>>
>>> Makes sense?
>>> ​
>>>
>>
>>
>

Re: Affinity Collocation

Posted by vkulichenko <va...@gmail.com>.
Hi,

The answer is YES. Everything with the same affinity key is stored on the
same node.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Collocation-tp4576p8626.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Affinity Collocation

Posted by ght230 <gh...@163.com>.
If Organization cache mode is Partitioned, 
We all know that it can save all the Person data with the same
OrganizationID in the same node.
For example: All Person data with OrganizationID(3) is save in Node(2).

But I still want to know, can it ensure the Organization data with the same
OrganizationID(3) also save to the same node(2)?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Collocation-tp4576p8603.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Affinity Collocation

Posted by Vladimir Ozerov <vo...@gridgain.com>.
Hi,

There should not be any problems with config like this because all
Organization entries will be located on all nodes in the cluster.

Vladimir.

On Wed, Apr 27, 2016 at 9:47 AM, Kamal C <ka...@gmail.com> wrote:

> What do you mean by cache configuration?
>
> If I go with the below configuration, will it create any problem ?
>
> Person cache                          - Partitioned, Atomic Mode
> Organization / Company cache - Replicated, Transactional Mode
>
> --Kamal
>
> On Wed, Apr 27, 2016 at 10:46 AM, Alexey Goncharuk <
> alexey.goncharuk@gmail.com> wrote:
>
>> Hi,
>>
>> As long as cache configuration is the same, affinity assignment for such
>> caches will be identical, so you do not need to explicitly specify cache
>> dependency. On the other hand, if cache configurations do differ, it is not
>> always possible to collocate keys properly, so for this case such a
>> dependency also does not seem legit.
>>
>> Makes sense?
>> ​
>>
>
>

Re: Affinity Collocation

Posted by Kamal C <ka...@gmail.com>.
What do you mean by cache configuration?

If I go with the below configuration, will it create any problem ?

Person cache                          - Partitioned, Atomic Mode
Organization / Company cache - Replicated, Transactional Mode

--Kamal

On Wed, Apr 27, 2016 at 10:46 AM, Alexey Goncharuk <
alexey.goncharuk@gmail.com> wrote:

> Hi,
>
> As long as cache configuration is the same, affinity assignment for such
> caches will be identical, so you do not need to explicitly specify cache
> dependency. On the other hand, if cache configurations do differ, it is not
> always possible to collocate keys properly, so for this case such a
> dependency also does not seem legit.
>
> Makes sense?
> ​
>

Re: Affinity Collocation

Posted by Alexey Goncharuk <al...@gmail.com>.
Hi,

As long as cache configuration is the same, affinity assignment for such
caches will be identical, so you do not need to explicitly specify cache
dependency. On the other hand, if cache configurations do differ, it is not
always possible to collocate keys properly, so for this case such a
dependency also does not seem legit.

Makes sense?
​