Mysql – synchronizing local and server database

backupMySQLmysqldumprestore

I am developing a billing system software. For this I have created a database it contains many tables database and this is in local system
all transactions data will be stored in local systems database.

I would like to provide data backup tables in server.
Whenever the person(billing s/w user) wants he/she can upload the data to server(only newly added data should be uploded if existing data is there).

If local system data is currepted or get deleted by some reason it can be downloaded from the database server.
This all features should be done by using billing software.
How to do this.

Best Answer

Replication, and daily / hourly backups (depending on your need), probably with something like xtrabackup, and storing the binlogs in between, give your pretty good point-in-time recovery. You might even configure pt-slave-delay to let your actual backup lag somewhat, useful for those moments where you are aware of an accidental deletion within the time-frame of your delay, making the restoration a bit less cumbersome.

I do not understand the requirement 'all features should be done by using billing software'. Billing software is for billing, not for database maintenance.