Answer the question
In order to leave comments, you need to log in
What is the best way to organize the project database architecture?
Let's say there is a site with blogs, each post can be like, which database structure will be more correct.
Conditions one user - one like.
There are two tables posts(id, content) and likes(id, id_post, id_user);
1 - Calculate using JOIN
2 - Add the likes field to the posts table and count and change its value with each like or unlike
I think the second option will be the most effective, I would like to know how professionals solve such seemingly small tasks.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question