1. A system comprising: one or more first computing devices providing a persistent-storage database operative to maintain a graph comprising graph nodes and graph edges connecting the graph nodes, a graph edge connecting two graph nodes indicating an association between the two graph nodes, each graph node corresponding to a profile associated with a social-networking system and having a unique graph-node identifier; and a plurality of second computing devices coupled to the one or more first computing devices and providing a cache layer between the persistent-storage database and a plurality of client servers, the cache layer comprising a plurality of leader cache clusters that each comprise one or more leader cache nodes and a plurality of follower cache clusters that each comprise one or more follower cache nodes, wherein each leader cache cluster includes a plug-in operative to translate graph information about graph nodes and graph edges stored in the cache layer to a command for the database, wherein the command includes one or more flat files, each leader cache node being operative to: communicate graph information between the follower cache clusters and the database, wherein each follower cache cluster maintains at least a portion of the graph; receive a request from one of the follower cache nodes to store graph information in the database; update the database storing the graph responsive to the request; and update one or more of the follower cache nodes storing the portion of the graph associated with the request.