Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What JDBC tools do you use for synchronization of data sources?

I'm hoping to find out what tools folks use to synchronize data between databases. I'm looking for a JDBC solution that can be used as a command-line tool.

There used to be a tool called Sync4J that used the SyncML framework but this seems to have fallen by the wayside.

like image 898
Nick Pierpoint Avatar asked Oct 10 '08 11:10

Nick Pierpoint


2 Answers

I have heard that the Data Replication Service provided by Db4O is really good. It allows you to use Hibernate to back onto a RDBMS - I don't think it supports JDBC tho (http://www.db4o.com/about/productinformation/drs/Default.aspx?AspxAutoDetectCookieSupport=1)

There is an open source project called Daffodil, but I haven't investigated it at all. (https://daffodilreplicator.dev.java.net/)

The one I am currently considering using is called SymmetricDS (http://symmetricds.sourceforge.net/)

There are others, they each do it slightly differently. Some use triggers, some poll, some use intercepting JDBC drivers. You need to decide what technical limitations you are under to determine which one you really want to use.

Wikipedia provides a nice overview of different techniques (http://en.wikipedia.org/wiki/Multi-master_replication) and also provides a link to another alternative DBReplicator (http://dbreplicator.org/).

like image 167
Aidos Avatar answered Nov 16 '22 03:11

Aidos


If you have a model and DAO layer that exists already for your codebase, you can just create your own sync framework, it isn't hard.

Copy data is as simple as:

  1. read an object from database A
  2. remove database metadata (uuid, etc)
  3. insert into database B

Syncing has some level of knowledge about what has been synced already. You can either do it at runtime by getting a list of uuids from TableInA and TableInB and working out which entries are new, or you can have a table of items that need to be synced (populate with a trigger upon insert/update in TableInA), and run from that. Your tool can be a TimerTask so databases are kept synced at the time granularity that you desire.

However there is probably some tool out there that does it all without any of this implementation faff, and each implementation would be different based on business needs anyway. In addition at the database level there will be replication tools.

like image 40
JeeBee Avatar answered Nov 16 '22 02:11

JeeBee