3

I am currently managing the backend server of an Android Application. We use DigitalOcean in Singapore, that we thought was a good location for China too. Unfortunately, testing the response time from within China gives > 6 secs

www.websitepulse.com/help/testtools.china-test.html

I am trying to figure out a way to replicate our infrastructure inside the great Firewall and was wondering what could be the best practice to setup a server there as well, considering that our API are read/write.

I am considering Amazon that also features a China Region, but the main problem remains how to keep in sync the two databases across regions, considering lag etc.

At the moment we're using Mysql+PHP but I have no problem on migrating the API services to other languages/DBS

Do you have any suggestion?

Many thanks.

  • Speedy great firewall. haha. Good luck! – hookenz Mar 10 '15 at 22:48
  • If I fully understand what you are trying to do, I would look at [Amazon Cloudfront](http://aws.amazon.com/cloudfront/details/). Maybe you can use the China CDN edge location to send files a China db instance ? – mindblowwn Mar 10 '15 at 22:29

2 Answers2

1

MariaDB Galera Cluster will allow synchronous database replication across WANs, assuming read and write access is required within China. MariaDB is a drop in replacement for MySQL so the transition should be relatively smooth.

It should cope well with high latency, and in the event that it does not an asynchronous option is still possible if some data loss is tolerable in the event of a complete node failure.

Check out this slide deck for an overview of using Galera Cluster over WANs and how the replication works.

jotap
  • 711
  • 3
  • 8
0

Amazon's RDS service provides you with the possibility to create cross-region read replicas. Using CloudWatch you can closely monitor the Replica Lag and e.g. setup alarms when it gets to high. I would suggest that you setup a RDS instance in one region and a read replica in another to see what kind of lag you could expect and whether or not it is acceptable.

Bazze
  • 1,511
  • 9
  • 10
  • Unfortunately Amazon China is not linked to the other regions so RDS replica are not available between for example Singapore and China (or Oregon and China) – Andrea Olivato Mar 04 '15 at 07:59