"Friends" data is well-described in a graph database. Neo4j is an example, though I know it's not the way Facebook stores this information.
Facebook uses a number of database technologies that may be involved:
- a patched version of MySQL
- Cassandra
- Hadoop
- ... others