i have a java application in italy that makes a number of queries to a database in italy when it's executing certain operations.The problems is that when this application is launched from china and it makes queries to the database in italy,the queries are slow and so operations that take 2 minutes in italy end up taking 30 minutes in china.I understand that the problem is caused by the poor quality of the WAN towards china but does someone know of any walk around this issue?Thank you
3 Answers
Put the database and app near of each other - network wise. If needed keep 2 mirrors, one for each continent, although this will bring additional challenges.
Set up Database replication between the two locations. Updates on the Master will be replicated to the slave. This will likely to be the best effective option to choose. It the network connection is poor you can optimize what's "in" (improve and limit querys) but in the end takes time.

- 11
- 3
-
"If needed keep 2 mirrors, one for each continent, although this will bring additional challenges."..as you have written,this would bring additional challenges and for now am avoiding it...." – alvy Jul 25 '17 at 10:03
If you consider a code change in your client as a possible solution I would suggest to play around with Statement.setFetchSize method. Thiw will let you optimize network consumption by tuning the size of results "pack" fetched iteratively.

- 8,057
- 2
- 11
- 27
The 2 minute query running in Italy is the first problem. Getting results to China is the second and more troubling problem. Please share with us one of your 2 minute queries as recorded in the general.log from Italy and EXPLAIN EXTENDED results for the same query, please. This basic information is needed to allow analyzing part one of your current situation.

- 2,094
- 1
- 11
- 19