Sunday, November 15, 2015

How Facebook’s Safety Check Works

Todd Hoff (comments):

How do you build the pool of people impacted by a disaster in a certain area? Building a geoindex is the obvious solution, but it has weaknesses.

[…]

When there’s a disaster, say an earthquake in Nepal, a hook for Safety Check is turned on in every single news feed load.

When people check their news feed the hook executes. If the person checking their news feed is not in Nepal then nothing happens.

[…]

Safety Check fans out to all their friends on their social graph. If a friend is in the same area then a push notification is sent asking if they are OK.

[…]

Using the news feed gives a random sampling of users that is biased towards the most active users with the most friends. And it filters out inactive users, which is billions of rows of computation which need not be performed.

[…]

Two machines in two different datacenters have a user that’s friends with the same person. This means both edges are traversed which ends up sending two notifications to the same person.

So they added a database and in-memory locking.

Alex Schultz:

This activation will change our policy around Safety Check and when we activate it for other serious and tragic incidents in the future. We want this tool to be available whenever and wherever it can help. We will learn a lot from feedback on this launch, and we'll also continue to explore how we can help people show support for the things they care about through their Facebook profiles, which we did in the case for Paris, too.

Comments RSS · Twitter

Leave a Comment