Symfony and MySQL: read/write on different databases on different MySQL servers - mysql

I have a PHP project written in Symfony that is using connection on different databases. An example is a users table on one DB and another related table on another DB.
This works well except that I am planning to move one of the two MySQL DBs to another physical MySQL server which means that the two DBs will not be on the same server any longer.
Is there a mechanism on Symfony to support this kind of setup using Doctrine and Entity Manager?
I was exploring the FEDERATED Engine on MySQL but this will work for ready only, what about the writes?
I have an example where within a form that a user can submit, there are fields from one and the other tables, hosted now on two different servers.

Related

How to configure 1 MySQL database running on 2 different servers?

For my current environment, I am running 2 separate Linux boxes each running MySQL. Each server should have the exact same db (one of the servers should host the db and the other one points to it). I know this could be possible using "federated tables" but the application that the database supports has hundreds of tables. It would be very recursive to point each table to the other db.
Does anyone have any suggestions how this could be possible? I have looked all over and have not found anything quite like this scenario.

query 2 database from different servers without using federate

I was looking into how to do a query between 2 database on different servers.
I am trying to select another database from another server and insert into my local server.
I am trying to migrate tables with different schema so I have to build its design to be identical to the new design before inserting.
Any suggestions? I was checking Federated but it required me to change the database engine on the remote server w/c I didn't want to do.
So, is this possible? If not, then I'll just use python to migrate and connect between 2 servers.

Best way to synchronize MySQL bases on different servers

I have two servers. One is located in our office, and its MySQL base contains our offers, our clients etc.
The second server is located at our hosting provider's datacenter. It uses the same database structure and the same offers, and I use it for our website.
I was synchronizing these two servers manually, by sending json from one server to another each few hours, but now I need a real-time synchronization.
Which way should I use?
Master-slave replication from company server to website server. The problem is, that our slave website database has its own changeable tables too. For example, orders, user sessions, viewcounts and so on. And I need to send somehow that tables to master server at office.
To use only one database for both servers. Problem is, that there could be up to 100 queries each pageview, and I think that running each query through internet could be quiet slow.
We cannot use only one server for all tasks because we are unable to provide a stable low-latency internet connection in our office. So when internet is down, our site or our CRM system would be down to.
May be there is a third and best way to do this?
You can try Data Comparison tool in dbForge Studio for MySQL. It will connect to two different MySQL servers (using simple connection, SSL, SSH or HTTP tunnel), compare them and show differences; then it will offer to run synchronization script or view/save it.
There is also stand-alone dbForge Data Compare tool.

transferring data from my database to my friends database

Just created a database in my own MySQL server. Now I want to transfer the data from my MySQL server to one of my friend's MySQL server.
Any idea how this can be done?
Also, how would I do this if I use oracle server?
If you have an access to his database - you can create dblink
Otherwise you have to export a dump and send it to your friend.
I have had to copy full databases (as well as just selected tables) between servers before and a SQL dump can be cumbersome if you have a lot of data. If you have access to both servers you might consider an application called "Navicat". It is a MySQL GUI interface to manage databases.
You can have multiple databases on separate servers open at the same time, and can even "drag and drop" tables between databases and databases between servers.

Synchronization of postgres and mysql database server?

What's the best way to synchronize few tables of mysql server with postgreSQL server?
Currently people are executing scripts, which takes much time, is there any fast solution available from which we can map the tables and columns to synchronize the db server.
You could expose the data from one and consume it with the other. Something like a web service, linked server, open data framework, ODBC driver, etc. Postgres has a nice ODBC driver that works pretty well.