Meta moved petabytes of social graph data with no downtime
· Do Minh Tuan · Future Pulse 🔮
Meta's engineering team published a write-up of a migration I keep thinking about. They replaced the data ingestion platform that moves several petabytes of MySQL social graph data every day, and they did it without a second of downtime. The social graph is the map of who is connected to whom and what they did, so this is not a side project. It is the part of the system that everything else reads from.
What interests me is not the scale. Scale like that mostly tells you the team had resources. What interests me is how they proved the new system was safe before trusting it, because that part transfers to a company with two servers and a nervous founder. The two techniques they describe are reverse shadowing and continuous checksum monitoring.
Shadowing is a familiar idea. You send a copy of live traffic at the new system while the old one keeps serving users, and you compare what happens. Reverse shadowing flips the direction. The output of the new ingestion pipeline is routed back through the legacy validation systems, so the old code checks the new code's work. The new system has to satisfy the old system's rules before it is allowed to take over. That is a clever way to use the thing you trust as the referee, and it avoids the trap where a new validator is written by the same people who wrote the new pipeline and shares their blind spots.
Checksums are the second half. A checksum is a fingerprint of a block of data, a short value computed from the bytes. Compare the fingerprint before and after a move and you know whether the bytes survived. Meta ran that comparison continuously rather than as a one-time check at the end. Continuous matters, because a migration that passes at 9am and drifts by 2pm is worse than one that fails loudly at 9am. The team could see, minute by minute, that nothing was being lost.
The bit I would steal first
If you take one thing from this, take the idea of a referee you already trust. Most teams migrating a database write a comparison script that checks the new system against expectations. That script is new code, written under deadline, and it gets tested against the new system rather than against reality. Pointing the old system at the new system's output gives you a much stronger signal, because the old system has years of bug fixes behind it.
Migrations fail most often because the team validated structure and not behaviour. Row counts matched, schemas matched, and the application still broke because one field meant something slightly different in the new pipeline. A checksum would not catch that either, which is the limit of this approach. Checksums prove the bytes are identical. They do not prove the meaning is. You still need behavioural tests on top, and Meta's write-up is clear that this was a full migration programme, not a script.
What I would ask before a migration like this
My first question would be about the rollback. Not the plan on paper, the actual measured time to switch back once the new system is taking traffic. If the answer is hours, the migration is not ready, however good the shadow results look. The second question is how long both systems ran in parallel and what the error budget was during that window. A migration that only works when nothing else is going wrong is not proven.
The third is about the people. Who is on call during the cutover, and what is the signal that tells them to stop? Meta can afford a large team watching dashboards. A smaller company needs a simpler trigger, and it needs to be agreed before the night of the change, not argued about at 3am.
For a small team, the practical version of this is double writing. Write to the old store first, keep it as the source of truth, write to the new store second, wrap that write so a failure cannot break the request, and compare the results. When the mismatch rate goes to zero and stays there under real load, you have earned the right to flip the read path. It is slower to build than a big-bang cutover and much cheaper than an outage.
The business side
The lesson founders should take is about phased rollout, and it applies well beyond databases. A new checkout, a new CRM, a new email tool: never switch everyone at once. Send a small slice of traffic first, watch it, then widen. Meta's version of this is a canary release to 5 percent of users, which is a reasonable default for anything customer-facing. If the new path fails, most people never noticed.
That sounds obvious and it is routinely skipped, usually because someone is confident. Confidence is not evidence. A canary is evidence, and it is cheap.
What I would tell a team in Vietnam preparing a migration for a client: write the rollback plan before the migration plan, and make the client sign off on the trigger for stopping. The technical work is the easy part. The hard part is having the conversation about what happens if it goes wrong while everyone is still optimistic.
The thing I still want to know about Meta's migration is how they handled the long tail, the tables that are huge, weird and rarely touched. Those are where migrations usually bite, and they are the least interesting to describe. I would read that follow-up before I believed any migration story that only talks about the happy path.
Written with AI assistance, reviewed and edited by Do Minh Tuan.