I'm creating a social networking site.
How do I create the relationships between users?
Many sites say to create a relationship/friend table, but, looking into the future, this would be ineffective. This idea could be as popular as Facebook and I want to be ready for that many users. Facebook has 400 million users so a friends table row count would be at least 150 times that. Doing a query for one's friends would be very slow.
Maybe the solution would be a separate table for each user containing their friends ID's or an associated CSV file containing the ID's.
Build the schema you need today, not the one you think you'll need 5 years from now.
Do you think facebook designed their schema to support 400 million users on day one? Of course not. Building for that kind of scale is complicated, expensive, and honestly, if you try it now, you'll probably get it wrong and have to redo it later anyway.
And let's be honest: you have a better chance of winning the lottery than hitting 400 million users any time soon. Even if you do, your project will have hundreds of engineers by then -- plenty of bandwidth for redesigning your schema.
Now's the time to build simple.
Edit to add some solid examples:
They went through a common evolution: single server, went to a single master with multiple read slaves, then partitioned the database, and then settled on a sharding approach.
Keep it simple! Simplicity allows you to rearchitect more quickly so you can respond to problems. It's true that nobody really knows what simplicity is, but if you aren't afraid to make changes then that's a good sign simplicity is happening.
Livejournal also grew from a single database on a single server to multiple sharded replicated databases
I'm sure you could find a dozen more examples on the highscalability blog