laravel which will also have likes and comments .
So I am assuming that I will have to make a table for post, user, like and comment ?
As well as post and like will be in many - one relationship ?
I would agree. But even within that, there becomes variance. Consider Telegram. PAID users can LIKE a single post multiple times with different icons. Think it through, on paper. Practice with your design. How will your design ensure it is fast... Even when you have 10 Million Posts, and 1 Billion Likes? But for PG, a separate table with likes will make it better than a counter on the post, where the post record would be updated with every like (which duplicates the entire row, save the toast).
Обсуждают сегодня