views:

189

answers:

4

We're moving a social media service to be on separate data centers as our other hosting provider's entire data center went down. Twice.

This means that both websites need to be synchronized in some sense -- I'm less worried about the code of the pages, that's easy enough to sync, but they need to have the same database data.

From my research on SO, it seems MySQL Replication is a good option, but the MySQL manual, for scaling out, says that its best when there are far more reads then there are writes/updates: http://dev.mysql.com/doc/refman/5.0/en/replication-solutions-scaleout.html

In our case, it's about equal. We're getting around 200-300 thousand requests a day right now, and we can grow rapidly. Every request is both a read and write request.

What would be the best method or tool to handle this?

A: 

Replication isn't instantaneous, and all writes have to be sent over the wire to the remote servers, so it takes bandwidth too. As long as this works for you and you understand the consequences, then don't worry about the read/write ratio.

However, are you sure that you need global replication? We handle millions of requests and have one location, with multiple web servers connected to two databases. One database is the live database, and the other is a replicated read only database.

We do have global fail over locations, and some people connect to these on any day, even if our main node is up because they have Internet issues. The data just trickles in though.

If the main node went down, then every body would be using the global fail over locations, in order. So, if our main node died, all customers would connect to Denver. If Denver went down, they'd all connect to Columbus.

Also, our main node is on two different Internet providers, so one ISP going down doesn't take us down.

Marcus Adams
I literally heard the term global load balancing about 2 hours ago -- what is global fail?You said you have one location -- for your servers? The main reason we don't want to do that is we don't trust (anymore) that one location one go down.
Kerry
Who do you use to do server management? Or do you have your own data center?
Kerry
While I don't consider this an answer to my question it is the best answer.
Kerry
A: 

Is the connection speed between two datacenters good enough? You can copy files to a new server and move database there. And then setup old server so that it will connect to new server's MySQL database in another DC? This will be slower of course, but depending on the nature of your queries it can be acceptable. As soon as DNS or whatever moves/finishes, you just power off the old server when there is no more requests for it.

FractalizeR
Yes, it's fast enough. It seems perhaps I should rephrase the question? My question is what is the best synchronization method, it needs to be High Availability and Synchronous
Kerry
A: 

Not an answer as such, but to help you to assess your options you need to consider what your requirements are in a disaster recovery scenario (i.e. total loss of the system in one data-centre).

In particular for this scenario, how much data can you afford to lose (recovery point objective - RPO), and how quickly do you need to have the standby data-centre version of the site up and running (recovery time objective - RTO).

For example if your RPO is no transactions lost and recovery in 5 minutes, then the solution would be different than if you can afford to lose 5 mins of transactions and an hour to recover.

Another question I'd ask is if you're using SAN storage at all? This gives you options for replication at the storage level (SAN array to SAN array), rather than at the database level (e.g. MySQL replication).

Also to consider is the distance between the data-centres (e.g. timewise can you afford to perform a synchronous write to both databases, or would an asynchronous replication approach be more appropriate)

Kris C
A: 

Most important topics. I need this topics. Thanks for sharing. but my question What do you understand by Synchronization in Java? please reply me. i am waiting for your reply.

marck_don