I’m trying to develop a web site, which has got two parts: a local part and remote part on the internet.
Users update local web site daily and remote web site should synchronize itself by local part (or it can be done by users manually).
The web site contains one mysql database with 4 or 5 tables and some images as files.
Now I’m searching for the best way to understand the system that this picture or row is new, so you should insert it or it has been modified, so update it.
I’m thinking about timestamp and random md5 as fields in every database and another database to keep names of files. So, check them and if one thing (timestamp or random md5) changed, update those rows.
Is this a good way, or is there an easier way to do this? I want to develop this web site with Yii or CodeIgniter and Mysql database.
For files, I would use rsync.
For MySQL, I would create a cron script that updates the SQL table.
The idea of a timestamp would work if you want to grab individual records at a time. Then you should keep a last_sync record, and select * from table where date > last_sync.
Quite a few ways to skin this cat.