You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by zshamrock <al...@gmail.com> on 2016/05/12 20:46:20 UTC

How REPLICATED cache is more performant comparing to PARTITIONED

I have couple of caches which are initialized per system event, and then
almost stay untouched for the next 1 or 2 hours. And only reads are used.
First of all is it a good use case for the REPLICATED cache? Data is small,
just int to int mapping.

The main question is why REPLICATED cache behaves better for frequent reads
comparing to PARTITIONED. As I understood from
https://apacheignite.readme.io/docs/cache-modes#replicated-mode, PARTITIONED
cache with backups set to all is used underneath. Is still affinity
collocation is in place for the REPLICATED cache? If, so it means it has to
go to the primary server every time anyway, so no different comparing to
REPLICATED. So, what are the factors who are giving the better read
performance for REPLICATED cache comparing to PARTITIONED?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-REPLICATED-cache-is-more-performant-comparing-to-PARTITIONED-tp4915.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How REPLICATED cache is more performant comparing to PARTITIONED

Posted by zshamrock <al...@gmail.com>.
Hi, Denis. Yes, actually this line "All the operations that are performed on
server nodes and use exchange rates in their calculation won’t need to go to
some primary node to load an exchange rate because all the data will be
located locally" answers my question.

I was just thinking about my use case, where I use the ignite client, and
near cache, even the data is small and updates are infrequent, it doesn't
make sense to make it REPLICATED, as I don't get any benefit from it in my
case.

Thank you.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-REPLICATED-cache-is-more-performant-comparing-to-PARTITIONED-tp4915p4939.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How REPLICATED cache is more performant comparing to PARTITIONED

Posted by Denis Magda <dm...@gridgain.com>.
Hi,

Replicated cache is used in cases when you need to store a small data set or data set that is not updated frequently.
In banks area dictionaries with exchange rates are usually stored in replicated caches because they are not updated frequently and they are relatively small. All the operations that are performed on server nodes and use exchange rates in their calculation won’t need to go to some primary node to load an exchange rate because all the data will be located locally. If the exchange rates are stored in a partitioned cache then the performance of the operations will worse.

Hope know the use case of replicated caches is much more clear to you.

Next, answering on some of your questions.

> As for the computing job, I would use the affinity collocation, so my job
> will utilize the local cache anyway.

If you use compute.affinityRun(…) then by default the job will be executed on a node that holds primary copy of the key.

> If I use the Ignite in the client mode (which means my client node doesn't
> hold any data), it still has to do the network call to the primary node of
> the REPLICATED cache.


Correct. If you want to cache some data on the client node then you can use near caches - https://apacheignite.readme.io/docs/near-caches <https://apacheignite.readme.io/docs/near-caches>

Regards,
Denis

> On May 13, 2016, at 8:10 PM, zshamrock <al...@gmail.com> wrote:
> 
> Alexei, but I still trying to understand the use case for the REPLICATED
> cache.
> 
> As for the computing job, I would use the affinity collocation, so my job
> will utilize the local cache anyway.
> 
> If I use the Ignite in the client mode (which means my client node doesn't
> hold any data), it still has to do the network call to the primary node of
> the REPLICATED cache.
> 
> So, what are the use cases for the REPLICATED cache. Do I miss anything?
> 
> Thank you, Alexei.
> 
> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-REPLICATED-cache-is-more-performant-comparing-to-PARTITIONED-tp4915p4935.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How REPLICATED cache is more performant comparing to PARTITIONED

Posted by zshamrock <al...@gmail.com>.
Alexei, but I still trying to understand the use case for the REPLICATED
cache.

As for the computing job, I would use the affinity collocation, so my job
will utilize the local cache anyway.

If I use the Ignite in the client mode (which means my client node doesn't
hold any data), it still has to do the network call to the primary node of
the REPLICATED cache.

So, what are the use cases for the REPLICATED cache. Do I miss anything?

Thank you, Alexei.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-REPLICATED-cache-is-more-performant-comparing-to-PARTITIONED-tp4915p4935.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How REPLICATED cache is more performant comparing to PARTITIONED

Posted by Alexei Scherbakov <al...@gmail.com>.
Hi,

Replicated cache have all entries available on the node, so reads from
REPLICATED cache are always local.

2016-05-12 23:46 GMT+03:00 zshamrock <al...@gmail.com>:

> I have couple of caches which are initialized per system event, and then
> almost stay untouched for the next 1 or 2 hours. And only reads are used.
> First of all is it a good use case for the REPLICATED cache? Data is small,
> just int to int mapping.
>
> The main question is why REPLICATED cache behaves better for frequent reads
> comparing to PARTITIONED. As I understood from
> https://apacheignite.readme.io/docs/cache-modes#replicated-mode,
> PARTITIONED
> cache with backups set to all is used underneath. Is still affinity
> collocation is in place for the REPLICATED cache? If, so it means it has to
> go to the primary server every time anyway, so no different comparing to
> REPLICATED. So, what are the factors who are giving the better read
> performance for REPLICATED cache comparing to PARTITIONED?
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-REPLICATED-cache-is-more-performant-comparing-to-PARTITIONED-tp4915.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov