What is the best data model and database systems to store social graph?

What is the best data model to store social graph?

  • Answer:

    The best data model depends on what kinds of queries and analytics you want to run against the data model. The most flexible data model is to organize your data in a literal edge-centric graph model. In this model, your data model is a giant set of links between people. There are no restrictions on the way in which you can traverse the graph for query or analysis purposes but traversals often require slow join operations under the hood. Most graph databases are organized this way. For faster queries, you can directly materialize some relationships so that they can be directly evaluated without graph traversal. For example instead of "A friend of B friend of C" for "friend of a friend" query which requires traversing two links, you can directly store "A friend of a friend C". However, by doing this you lose the ability to ask questions about the "A friend of B" or "B friend of C" unless you store that information as redundant structures. Many real-world social graph analysis companies precompute common queries in this way for performance reasons.

Andrew Rogers at Quora Visit the source

Was this solution helpful to you?

Other answers

You store it as a graph structure. You can try Neo4j http://neo4j.org/

Prathab Kali

Basically, it is a semantic-graph structure. That is - a graph, where the links themselves may have meta-data, such as: semantic meaning (e.g. relative-of, friend-of, blocked), time of link creation and much more.

Avi Tshuva

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.