Using ChronicleMap as a distributed lock

72 views
Skip to first unread message

Ryan Lea

unread,
Jun 19, 2015, 2:09:38 AM6/19/15
to java-ch...@googlegroups.com
Is it possible?

I took a quick glance over the API and noticed acquireUsingLocked but it appeared to be a process level lock rather than distributed - is this the case?

My two questions realistically are:

1. Is it possible to detemine the number of connected nodes within a replicated Chronicle Map?
2. Does Chronicle Map provides distributed locking of its key/value pairs?

Thanks

Ryan

Peter Lawrey

unread,
Jun 19, 2015, 2:28:01 AM6/19/15
to java-ch...@googlegroups.com

Chronicle Map provides locking across a machine. This means if you have multiple JVMS on the same machine they will all honour the lock.
In the distributed across machines case, we are looking to support hashing of data by actor so that only one server appears to be master of that entry at a given moment. This avoids the need for a distributed lock and should be much faster.
In the case of split brain, we use eventual consistency with last one wins.

We could support a true distributed lock but it is not on the road map as yet.

Regards,
   Peter.

--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Lea

unread,
Jun 19, 2015, 2:39:59 AM6/19/15
to java-ch...@googlegroups.com
Ah, ok.

Was just musing over whether we could using Map rather than JGroups for cluster awareness at this stage.

Thanks for the prompt reply (as always)!

Peter Lawrey

unread,
Jun 19, 2015, 3:40:18 AM6/19/15
to java-ch...@googlegroups.com
Hello Ryan,
   Cluster awareness is something we are adding to Chronicle Engine (Open Source)  You will be able to see which nodes in a cluster are up/down, be notified when this happens and obtain a history.

Regards,
   Peter.

Ryan Lea

unread,
Jun 21, 2015, 6:01:18 PM6/21/15
to java-ch...@googlegroups.com
Hi Peter,

Sounds interesting.  I'll take a look at it, when it's available.  I always prefer a smaller tech stack than a big one!

Cheers

Ryan

Peter Lawrey

unread,
Jun 22, 2015, 2:14:27 AM6/22/15
to java-ch...@googlegroups.com
As do I.  I am going through the new versions of Chronicle looking for things to remove rather than to add. ;)
Reply all
Reply to author
Forward
0 new messages