j_watson's avatar

Can anybody help me with my task.

Do social networks such as Facebook and Instagram save friends or followers' IDs in an array in the database?

0 likes
3 replies
jlrdw's avatar

Also I am not sure, but they probably use related data. See the laravel documentation on Eloquent. They may use a pivot table. Take the 30 days to learn laravel course here.

1 like
Snapey's avatar

They will use relationship tables that describe the relationship.

for instance a table like followers that stores the id of the person being followed and the id of the follower

From this you can see which users follow a specific user, or which users a specific user follows.

1 like

Please or to participate in this conversation.