Abhishek Jain
Abhishek Jain

Reputation: 6376

How would be data stored at database in case of social networking site?

In social networking site, a person has friends/followers. There is a chain of relation. How would be data stored at database in this scenario? This is a very huge information, still result of a query comes back very fast on these sites.

Is it possible that someone explain the relations between various entities? What does make the search result so much fast?

What type of algorithm is implemented?If possible give me example.

Upvotes: 2

Views: 2482

Answers (2)

user297250
user297250

Reputation:

Facebook developed a custom NoSQL database for their inbox search, which has since been open-sourced. http://en.wikipedia.org/wiki/Apache_Cassandra.

There are some interesting topics related to your question on facebook's engineering page - http://www.facebook.com/Engineering.

Upvotes: 3

Adriaan Stander
Adriaan Stander

Reputation: 166626

This would seem like a MANY-TO-MANY Situation.

Something like, where UserRelations.UserID and UserRelations.UserRelatedID should be foreign keys to Users

Users
 - UserID
 - UserName

UserRelations
 -UserID
 -UserRelatedID
 -RelationshipType

Upvotes: 4

Related Questions