databasedatabase-designsocial-networking

Database design for a social networking site


What tables would be present in a social networking site database? (ex: Twitter)

I have a users table.

How do I keep track of followers and people followed?

Should I maintain a separate table for followers and people followed?

What are the columns in the tables?


Solution

  • Try having a look at Database Answers in particular the data models. They have several different designs for various systems. This one is for a social networking site which may give you an idea of what's required.

    You may want to search on SO for other social network database questions. I found this one that had a link to flickr showing a schema which appears to be from Facebook.

    Your database design will be based around your system requirements. Without knowing exactly what you are trying to achieve, it is difficult to give you the best design.