Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6137253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:42:08+00:00 2026-05-23T17:42:08+00:00

I am wondering how exactly the information that a user with id x is

  • 0

I am wondering how exactly the information that a user with id x is friends with users with ids z,y,w is stored in a very large scale app like facebook.

I am thinking of several possibilities

a) Have a table which maps friendships with the ids of the people involved as foreign keys, as shown here:

Person|isFriendsWith

x ——————-y

x —————— z

x——————- w

Which seems to me it wouldnt scale well at all.

b) Have a field in the users row that stores the ids of their friends in a kind of serialized format like a string “#z#y#w”. I suppose with the right algorithm the parsing and updating of this string would be easy.

c) Have a separate table with the friends of each user. Would this be too much load on the server?

d) Something else?

So, if anybody knows what facebook does and can share details it will be appreciated, that’s what the question is about. Also, if someone can share insight why what I listed here would not scale well or would have other problems performance-wise, I am interested in hearing it.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:42:08+00:00Added an answer on May 23, 2026 at 5:42 pm

    Here are some links. The first link’s page has a link in it on the words “largely complex” that link to a flickr image of a schema. I cannot vouch for the correctness of any of the information in these links:

    http://www.makeuseof.com/tag/facebook-work-nuts-bolts-technology-explained/

    http://www.theregister.co.uk/2011/07/13/mike_stonebraker_versus_facebook/

    http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/

    http://snarfed.org/facebook_data_store_api_thoughts/

    The image I mentioned was created by analyzing the business entities in the API that Facebook has opened up. http://blogs.x2line.com/al/archive/2007/06/02/3124.aspx
    That was 2007, so may or may not be representative any longer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering , what exactly is stored in the memory when we say
I'm just wondering exactly what factors affect how quickly createthread executes, and how long
I was reading litb's question about SFINAE here and I was wondering exactly what
I'm wondering how exactly the XAML sample ( MSDN sample ) works: <Style x:Key=textBoxInError
I was wondering how exactly does TCP implement in-order delivery. lets say this is
I am wondering how exactly I can convert a location (X Y Z) to
Reading some posts from Jimmy Boggard and wondering - how exactly is it possible
I was wondering about how to exactly implement domain service in RIA. Is it
I was wondering if somebody could help me with how exactly to write some
Wondering if there is any way to get the lambda expressions that result from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.