Welcome Guest, Not a member yet? Register   Sign In
How save in to two server database
#1

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
Reply
#2

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.
Reply
#3

(09-23-2019, 11:37 AM)jreklund Wrote: 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.
I know but can i use this feature with Codeigniter?
Because if it be,solution will be easy
Reply
#4

@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.
Reply
#5

Thank you my friend
Reply
#6

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB