Hello, I would like to know how to create a friendships system for my facebook-style application. I'm not making a social network, but I need to implement that system.
I have a table of users where I store data like id and username of the registered people.
I saw some solutions out there that said to create a "friends" table, and in that table write the id of the requestor, and the id of the requested, hence when the user logged in, the system would load his friends from this table. But in performatic terms, in case the application gets very large, this solution seems to me to be very unfeasible. It would take a long time to load the friends of a given user, if the table had, for example, 50,000 records.
Does anyone have any idea how I can do to create this system in an efficient way?