Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do big companies (like, say Facebook) do migrations without having downtime?

OK, a small company can just notify their users, then 404 their website while they upgrade their database / code. But this is kind of ugly, and discourages regular iterations.

How do really big companies (like Facebook) do migrations, without having downtime?

like image 662
wisty Avatar asked Jul 19 '11 00:07

wisty


People also ask

How does Facebook update without downtime?

Leveraging the layered architecture and the end-to-end control, the Zero Downtime Release framework introduces novel signalling and connection hand-off mechanisms through which a restarting component can shield the users from disruptions while maximizing their ability to keep serving traffic to ensure zero downtime.


2 Answers

The key component is the database. A method that I've seen involves using replication to mirror data across two servers. Once this is setup, the primary database server can be upgraded while the application servers are pointed at the secondary (replicated) server. Once the primary DB upgrade is complete, application servers can be lazily upgraded and pointed at the upgraded DB. The trick is ensuring that the app servers can deal with multiple DB schemas. To do this, you're looking at having several clusters of servers behind some sort of load balancing appliance. It's not cheap :).

like image 157
GregB Avatar answered Sep 28 '22 05:09

GregB


They use clustered solutions with massve parallelism, so they can take one server out of the cluster without impacting service, upgrade it, then put it back in the cluster. This typically requires releases to be backwardly compatible.

like image 36
Bohemian Avatar answered Sep 28 '22 04:09

Bohemian