Sync MySQL database

Dear Experts,

I have question pertaining to MySQL database. I have more than one MySQL databases. One is from the web hosting service and another is from in house. I wish to communicate with the MySQL DB from web hosting service with in house. Currently I am trying to sync the online DB with in house DB with a text file. I simply use the PDO to read off the data from in house DB and convert it to text file. I upload this text file through FTP to the web hosting site and use the PDO to read of the text file and insert the data to online database. If I need the data from online, I simply reverse above process along with email notification with an attachment of the data.

 Is there a better way that I can sync the data tables from  web host service with the data tables from in house MySQL DB?  How can I accomplish this?

Here are the conditions:
1. the company can tolerate few second of database update which does not need to be up to the second but will be better if can achieve the full sync in few seconds.
2. table columns ranges from 6 to 10 and rows are between 10k to 50K of rows per table.
kisegiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Are both of the data bases online at URLs that can receive GET and POST requests?  If so, you can set up a RESTful web service that can sync the data.  

How many tables are involved?
0
kisegiAuthor Commented:
To Ray_Paseur:

Currently there are two tables but I wish to incorporate all 10.

Currently the in house DB isn't online. We tend to keep the in house private. Is there a work around for this?
0
Ray PaseurCommented:
You might consider client authentication to keep in the in-house DB private.  Nobody would be able to get to the information without the username / passphrase.  If you can put both of the data bases at URLs with PHP scripts, you will be able to have scripts that can sync the data base tables.
0
arnoldCommented:
there are many options but all as pointed out depend on the access.
Are you able to establish an ssh or a VPN connection to the system where the hosted mysql is?
With ssh one can create a tunnel to the mysql instance, you can then locally access both the remote mysql and the local and perform what you need.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniel HelgenbergerCommented:
What about plain MySQL replication, may this be an option? This way changes from master servers would be nearly instantaneous in your in house db:
http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.