Skip to content

TAO

Posted on:October 24, 2020 at 11:22 PM PT

TAO

TAO is a distributed datastore serving with API tailored for social graph.

Background

Facebook original used Mysql + lookaside cache(memcache), and encountered below issues when dealing with social data model:

TAO suits for social graph model with much higher read than write

Data model and API

A typical social graph model:

/assets/TAO/Untitled.jpg

Objects and Associations

There are two data types in TAO: 1) Objects, typed nodes 2) Associations, typed directed edges

Object: (id) -> (otype, (key -> value)*)
Assoc: (id1, atype, id2) -> (time, (key -> value)*)

Associations naturally model actions that can happen at most once or record state transitions, such as the acceptance of an event invitation, while repeatable actions are better represented as objects.

TAO provides simple api to crud Objects and Assoc

Association query API

TAO’s assoc query api mostly built to get assoc list:

Association List: (id1, atype) -> [a_new...a_old]

Architecture

Storage Layer

Caching Layer

Leaders and followers

Scaling geographically

/assets/TAO/Untitled1.jpg

Consistency and Fault Tolerance

Consistency

Failure Detection and Handling