Near-cache, invalidation, and consistency?

521 views
Skip to first unread message

Joe Planisky

unread,
Oct 17, 2012, 5:27:39 PM10/17/12
to haze...@googlegroups.com
I'm not sure I completely understand near-cache and invalidation. The documentation says:

"Near cache breaks the strong consistency guarantees; you might be reading stale data."

and the example configuration says:

"Should the cached entries get evicted if the entries are changed (updated or removed)."

I can understand that having invalidation turned off would break strong consistency, but it seems to me that if invalidation is turned on (<invalidate-on-change> is "true"), we should retain strong consistency. If it doesn't then I don't really understand what <invalidate-on-change> does.

Does setting <invalidate-on-change> to "true" guarantee strong consistency?

--
Joe

Talip Ozturk

unread,
Oct 17, 2012, 5:42:42 PM10/17/12
to haze...@googlegroups.com
If you have <invalidate-on-change> turned off, then you might be
reading an entry which is updated seconds ago.

If you have <invalidate-on-change> turned on, then invalidation
messages will be sent to all nodes upon update so invalidation will
happen really really fast (microseconds) but it still cannot guarantee
strong consistency as there is still some microseconds of delay. So
you might be reading an entry which is just about to get invalidated.

Strong consistency means you should only be reading the latest version
of the entry; not from a cache by any means.

-talip
> --
> You received this message because you are subscribed to the Google Groups "Hazelcast" group.
> To post to this group, send email to haze...@googlegroups.com.
> To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
>
Reply all
Reply to author
Forward
0 new messages