简体   繁体   中英

sync database between local and live, php mysql

I am working on a "point of sale" project, here's what i have:

  1. i have a local database, maybe mysql db, csv file, or even xml file which store the data of customers.
  2. i have a system database on my own server with full data.
  3. after a specific period of time, i want to sync the data between local one and live database, to update or insert latest data.
  4. if there's no internet, it will keep the offline data until internet is back and start sync again.

my questions are:

  1. which local data type i should use (mysql db, csv file, xml file, or something else)?
  2. how to manage a sync process like this?

If the device hardware is able to run a MySQL server without performance issues then I would use MySQL on both the device and the server. This would save from translation between different data formats. Also you can benefit form MySQL's replication capabilities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM