You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Ross Black <ro...@gmail.com> on 2013/08/06 09:04:02 UTC

newbie question: SharedValue vs NodeCache

Hi,

I have just started using curator and was trying to pick between using
SharedValue and NodeCache for solving a problem.

I need to periodically publish a value (a JodaTime Date object, or a long
is ok) so that all interested processes receive a new value.  Publishing a
new value is infrequent (each 30 mins or so).  Reading the value is
frequent (100times/sec).  Both SharedValue and NodeCache look similar - is
there any reason I should pick one over the other?

Thanks for any pointers,
Ross

Re: newbie question: SharedValue vs NodeCache

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
SharedValue behaves more like an atomic operation. NodeCache is a cache for a node. To be honest, I totally forgot about SharedValue! I have a terrible problem with memory (not kidding). These recipes were written at different times and probably could be merged at some point.

-JZ

On Aug 6, 2013, at 12:04 AM, Ross Black <ro...@gmail.com> wrote:

> Hi,
> 
> I have just started using curator and was trying to pick between using SharedValue and NodeCache for solving a problem.
> 
> I need to periodically publish a value (a JodaTime Date object, or a long is ok) so that all interested processes receive a new value.  Publishing a new value is infrequent (each 30 mins or so).  Reading the value is frequent (100times/sec).  Both SharedValue and NodeCache look similar - is there any reason I should pick one over the other?
> 
> Thanks for any pointers,
> Ross
>