How save in to two server database |
Hi
I have two database in two server Can i insert record a two database same time Example when i execute below query $this->db->set('title','asdsad')->insert('tbl'); Save this record in server A and server B same time Thanks
Personally I would set up server A as a master server and B as a slave. That's something that should be done on server level.
@omid_student,
Of course you can use it with CI the catch is... do you have full control/access to the master and slave databases. In most cases (if you are using a regular hosting account, you probably don't) you may have to look at having a cloud database which should have this as a feature. You could also, capture all updates going to the db server and send them to another server but this is a manual and not highly recommended solution.
I strongly suggest against it. There is nothing that we guarantee data integrity, one query might be OK on one server but not the other. And you will end up with mixed content.
|
Welcome Guest, Not a member yet? Register Sign In |