The two tables here are :
user_table
–user_id (int)
–user_name (int)
–user_profile_link (varchar(max))
–user_joined_date (smalldatetime)
–user_thumbnail_pic (varbinary(MAX))
follower_table
–follow_id
–followed_user_id ( who i am following )
–following_user_id ( who i am )
–followed_mutual ( default : NO ) — to identify if both are following each other
is this approach correct ? or do i need something else to make this tick ! need some advice on this guys…thanks
I (personally) would create separate one-way relationships. If user 12 follows user 37 and it’s mutual, then
follower_tablewill have two recordsAlso, I would go ahead and duplicate reverse relationships
This makes queries easier, and also greatly simplifies sharding of data, should you ever need to split your data across multiple DB servers.