0

I have this technical task, 2 times this week.

Task consist to link, connect and work with 2 Databases on different servers. Inject the datas from the old DB into the new DB. As this the old DB is use like an accessible backup and the new server will be more light, just get the datas when it needs.

I saw there is relational DB-tables but it needs to be on the same server no ?

Does an online Cloud works this way ?

Thanks

Noe

user2731506
  • 73
  • 1
  • 9
  • You can write PHP code to connect to 2 different databases within the same MYSQL Instance. Or 2 databases each in a different MYSQL Instance. Just `new PDO()` twice with different parameters, and keep both connection handles – RiggsFolly Jan 26 '16 at 15:35
  • If you want just a backup I don't really understand why do this. I want you to remember that mysql is not horizontal scalable so why put on two differents server? – Isky Jan 26 '16 at 15:40
  • What would be the point? why you trying to do this? – Sergio Ramalli Gomes Jan 26 '16 at 15:44
  • Hi Mattia, Well there's a Data contributor that we have to connect to his Database to inject in an other one (client website). Items to sale. Well only texts and maybe images. Thanks – user2731506 Jan 26 '16 at 15:59
  • @user2731506 just use curl to post data from other website – Sergio Ramalli Gomes Jan 28 '16 at 12:43

2 Answers2

0

You can use distributed tables in MySQL whenever FEDERATED engine is used.

Otherwise you have to create application that will connect both databases and transfer data between them. With any programming language. Even with MS Access :)

Or use internal replication engine if it suits.

Community
  • 1
  • 1
Ostin
  • 1,511
  • 1
  • 12
  • 25
0

What you need is a service like google cloud,

First you would create VM instance and load balance the mysql connection between two databases.

Note** If you want faster or more lean mysqls calls, you should try indexing. try the link below @http://www.infoworld.com/article/2616674/database-administration/10-essential-performance-tips-for-mysql.html