I want to synchronise 2 database tables located in 2 differents servers with a different schema, for example :
Table A fields : id, article_value
Table B fields : article_id, article
Table A is used by one program, table B by an other program.
I want to create a synchronisation script which sync both tables to have the same entries.
I have thought about creating 1 table containing the fields :
A_number (number of articles in table A), B_number (number of articles in table B).
So when the script is launched it counts the number of entries in Table A, and compare with the field A_number. If there is more entries, it adds them in Table B and then update A_number.
Same thing in the other direction.
Is this the best way to do that ? in php
Could you add a “last modified” time stamp on both tables? Then you would always know if a row was modified since the last synchronization.