backup for good running system
This is may be not program question, but i guess its program logic question. I done o开发者_Go百科ne small shopping application, tomarow its goes for live, now application working fine.
Technologies used for Application: PHP, MySQL, JavaScript
For this shop regular customer arraivals nearly 1000 customer per hour, i have around 10 to 15 counters, my application will run concurrently, one server and 15 clients setup, this is environment and basic details about shop and application, now my small doubt is, assume if system suddenly crashed, What is the step i should take?
Example: I go with hand billing else i should user secondry database. If hand bill means little bit prob is TOO much of work load for operator. I have another database, same table are there, assume if somthing gone wrong shall i go with secondary database?
Ok this is scenario: I done billing around 1500 for 1501 my system gone crashed. If i go with another secondary database then billing will start from 1 know, so i guess some duplication bill no probl will occur?
I need your suggestions and ideas,
Thanks
I guess you could set up a couple of CRON Jobs to automate backups every few hours and if it can't connect the mySQL server or isn't able to load a page then it reverts to a maintenance page and sends you an email for you to fix it.
I am not too familiar with using backup databases, but I imagine you could set up a CRON job to check the database every 10 minutes or so and if it doesn't get a response it changes the server you connect to the backup database? However with this you would have to do quite a bit of testing to make sure everything works properly.
You could look at setting up master/slave setup. See the MySQL documentation but essentially you switch on binary logging which is a copy of the transaction on the master (transaction in the sense of a write to disk not 'ACID Transactions") and these are then sent to the slave and written to the slave database. So the slave is usually only a few transaction behind the master. Then set up a failover mechanism, automatic or manual that switched the http server to the slave database. This presupposes that you have the hardware and a good connection between the servers to achieve this, however it does give a reasonable degree of protection from data loss and 'uptime'
精彩评论