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.