Why Facebook built TAO

video locked
Enroll to watch

9 mins

Chapters
About
Discussion0
Notes
Be the first to start a conversation!

TAO is Facebook's in-memory graph based cache with a minimal API.

In 2009 Facebook was answering a lot of graph queries. A profile page fetches the friends, the liked posts and the places of one person. Another query asks whether Gaurav is a friend of Anubhav. MySQL and Memcached hold columns and key value pairs, while a graph is a set of objects linked to each other.

So each team wrote its own objects and relations in code, and repeated the optimizations of the other teams. TAO rolls them into one library.

TAO is a real time store. An analytical query, such as comparing the locations of two people, runs in batch on a data copy.

The requirements:

  1. 1 billion reads per second. Of every thousand queries, 998 are reads.
  2. Multiple petabytes of data, in a graph that is hard to shard.
  3. A pull architecture in the clients, which can cause a thundering herd.
  4. A read hit rate of 95% and a read latency of 25 milliseconds.

Cost is not discussed.