How does 6-degrees work?

Filed under: Web/Tech | 3 Comments

As if you couldn’t tell, I’m a 6-degrees fan boy. For all the programmer types out there, how does the database side of the whole concept work. For example, on Friendster I see:

You <-> Jolene <-> Michael <-> Ricky <-> Kelly

I’d assume that all the users are stored in a table, with a column containing friends. Let me know if I’m off base here. To make things simple, lets say the table looks like this:

ID | USERNAME | FRIENDS

In MySQL, how would you get to Kelly? It might be fun to do a little open source social networking. Friendster is going to go pay soon, and it’s already slow. Hipstir is fun, but still not open source.

Read the latest posts

3 Responses to “How does 6-degrees work?”

  1. Brian says:

    Ah, what a good idea. My thought on the db: must be in the query syntax, some way of querying one’s friends and then their friends 5 layers deep. Anyway, that’s all MIS has taught me this semester…

  2. Jon Gales says:

    I’ll check it out if you tell me how it works :P. I’ve heard a lot of good things about MySpace. Keep up the good work.

Leave a Reply