I am developing a Java app where several computers need to keep some a data file in sync. I cannot use a central repository, and I would like to use an existing system that does the synchronization rather than write my own.
I have been thinking of Git, as it is one of the version control systems that is distributed and can work without a central repository. (SVN is out of question since it depends on a central repo).
The computers will talk to each other via a messaging system such as JMS, using which they will keep the data in sync.
Is using Git a good idea? Is there a better method? Is it possible to easily plug in Git with my Java code, so that it works transparently to the user?
[EDIT: giving some more details of my requirements.]
There are three computers A, B, C which are somehow able to talk to each other (i.e., send strings to and receive strings from each other). This communication ability is outsourced and I am given read and write operations for this. The computers may not use standard protocols such as TCP but the bottomline is that the read and write functions work as required – transferring a string from one point to another.
The computers may not be online all the time.
I now want to hook up GIT or some other file sync tool so that I can keep a particular directory on A, B, C synchronized. I am inclined to use GIT because it is fast and does not require an omnipresent central server. However, I will need GIT to communicate over my read and write methods rather than use the TCP/IP stack that it normally does.
Can anyone provide some hints on how to accomplish this?
It’s hard to suggest a solution without detailed knowledge of your requirements, but have you checked out Hazelcast? It has distributed implementations of a lot of the Java collections. It works over a multicast network and requires pretty much zero setup.