Replicating key, value pairs to one or more distributed nodes

69 views
Skip to first unread message

Guy Pardon

unread,
Mar 29, 2015, 8:58:21 AM3/29/15
to java-ch...@googlegroups.com
Hi,

I am looking at Chronicle to replicate key, value pairs of serialised object entries among one or more nodes. The goal is to avoid data loss in case my application crashes, by having one or more copies in a cluster. I have a few newbie questions:

1. what is the best structure to do this? ChronicleMap? 

2. what is the best way to ensure this? For important writes, I want the guarantee that a copy exists when the write method returns.

3. what if I want to add file-based persistence to the mix? does that change a log to the above?

4. what about class loading problems when serialised objects are replicated across a cluster? do all classes / jars have to be available in the same version on each node?

Thanks!
Guy

Rob Austin

unread,
Mar 29, 2015, 11:41:43 AM3/29/15
to java-ch...@googlegroups.com
1. what is the best structure to do this? ChronicleMap? 
Yes - Chronicle Map

2. what is the best way to ensure this? For important writes, I want the guarantee that a copy exists when the write method returns.
I suggest that you use a stateless client map.put(), this will ensure that a copy has been stored on another host. - the put is blocking,  it won’t return until an acknowledgement has been received by the remote node, but be sure to set <chronicle map builder>.putReturnsNull(false), otherwise the put won’t block.


3. what if I want to add file-based persistence to the mix? does that change a log to the above?
No - file based persistance is orthogonal to these other issues

4. what about class loading problems when serialised objects are replicated across a cluster? do all classes / jars have to be available in the same version on each node?
Yes - keeping the objects on the same version across nodes is a good idea, especially if you are using java serialisation, but you can use other forms of serialisation such as our proxy objects - see https://github.com/OpenHFT/Chronicle-Map/tree/2.1#off-heap-storage-and-how-using-a-proxy-object-can-improve-performance, note the interfaces used by these proxy objects will also have to be the same across nodes.

--
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.

Reply all
Reply to author
Forward
0 new messages