What is the recommended approach for synchronizing data between different applications?

I have an application written in J2EE + Spring + Hibernate (call it app1), now my boss wants another application (application2, completely different and written by different technologies) to be able to synchronize with it regularly (at least one path app1 to app2). I have never done anything like this ... I can think of a problem: app2 calls app1 (possibly using a web service), how do I know what part of the data has been added and updated since the last synchronization? What can I say about adding a timestamp column to each table of the main application2, so that app1 can say “give me everything that has been changed or added after timestamp xxxx. This includes changing many things. What other functions can I use to solve this Problems,without changing the application structure too large? (Assume the databases are different, and I don't want the database ports to be open to everyone on my server).

Finally, I forgot, how about deleting a row? Timestamps will not solve this ...

+3
source share
4 answers

You can save the change log in the application 2. An insert / update / delete trigger can support this log table. App1 can read the table to receive changes and periodically delete processed log lines.

+1
source

Take a look at Terracotta (http://www.terracotta.org/), it is a very reliable structure for synchronizing objects between machines.

0
source

, - . , .

0

, , 2, , , 1 (, 2 , / 1)?

If so, why not just point app2 to the same database as app1?

0
source

All Articles