I’m working with another developer to develop a sort of social networking site, where people can make Friend Requests similar to that in Facebook. However, he’s storing each user’s friend as comma-separated values:
user_id | user_friends
101 | 102,103,105
I’m convinced that this is very inefficient and error-prone. I’d personally use a relational database model and create another table with columns friendship_id (PRIMARY KEY), friender_id and friended_id.
Am I right? And what arguments should I give to support my stance? Cheers
You’re right.
With his system, how will you handle the status of the friendship request (i.e canceled, pending, accepted) ?
Parsing the user_friends string will be a pain and you won’t be able to use joins for complex data fetching.