1

I need a two way synchronization of tables if some thing insert in database1 's table then that thing automatically insert into another database which is database2's table. Could be possible in PHP? Is there any step by step procedure which can i follow for two different database which is stored on two different servers.

4
  • digitalocean.com/community/tutorials/… Commented Apr 27, 2017 at 4:44
  • @chris85: There are two different database i want if one table data is update in first database that data is updated in second database with another table and vice versa Commented Apr 27, 2017 at 4:51
  • Oh so both are being written to, yea standard replication wouldn't work there. Commented Apr 27, 2017 at 4:52
  • Is trigger or events help ? Commented Apr 27, 2017 at 5:05

1 Answer 1

1

it is "possible" (in general), but not immediate. for immediate action within the transaction you would need to do it on the DBMS with triggers and procedures. so have a look there.

doing it in PHP it may probably mess up things, but you can check on "db1" for a change since last check and process it to "db2". but if there is one transaction on "db1" and the next on "db1" follows fast, the data might not be in the state you wish to have.

or you just build the architecture differently as this sounds a bit odd to me. your description doesn't really tell why this would be done that way or even why there is need for two databases.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.