I'd like to programm a system where a user can follow another user but I don't know if I should do it with a nosql db like mongodb or any other or is it better with a sql (postgres)?
I know that with postgres I need a pivot table because it is a many to many relationship. I thought I can put in the users collecion something like { followers : [ user_id1, user_id2, user_id3 ], } and I can get them a little faster. In that case I can get the other users by their id. Can I get the followers and the following people of this user like this. is it faster or Am I wrong?
I am planning that every user can have many followers. Also I need that this app can receive many request and for that reason the performace is important.
What should I use in this case? A pivot table with postgres or mongo? By The Way I am using Nodejs.
Thanks in advance!