开发者

MySQL database issue with international users hitting a US server. How is this normally handled?

I have a site which hits a MySQL database that's in the cloud with Amazon. The site is located on different servers and which server serves up the site is dependent on the location of the user. All is well when the DB is hit from the US, but when users in Asia or Europe open the site, it just hangs because the call to the DB is taking too long.

As you can tell, I'm 开发者_如何学Pythonnot very experienced at all with "server stuff" (I've always worked with people who do this kind of thing FOR ME) so my question is simply...How is this typically done? I can't imagine that there is normally 3 different instances of the MySQL DB that sync up with each other. What is a typical architecture to handle this kind of thing?

Thanks. Sorry for the somewhat basic question, but any help would be appreciated in educating a web guy on how things should be done under the hood.


Actually, having multiple instances of MySQL that sync up (look up replication) is not such a bad solution at all. It does have downsides though, which is why newer websites look for different solutions. For example, they try MongoDB or CouchDB instead of MySQL because it scales and replicates easier. Caching can also help a lot. Use a distributed cache (memcache pool, Varnish cache, etcetera) and make sure that your applications seldom have to hit the database directly.

The simplest thing would be: why are you distributing users over geographically disparate servers to begin with? Can't you serve international users from servers in the US as well?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜