I am trying to create a blogging sites. My problem is how to handle the blog database system.
For example , i have a scenario like for each blog there may have more comments,likes,photos,videos for one blog. so i created separate table for comment,likes,photos,videos and insert each record with related blog id (ex : one blog can have more than one photos,comments ,videos...).
But the problem i am facing really when i am trying to create a summary of the blog by creating a view for blog with related tables. The blog view has duplicates when i joining blog table with comments,likes,videos tables using blog id.
Please help me on this ? can anyone suggest any idea for handling this problem or can anyone would know how fb or twitter handle this situation ?
please correct me if am wrong i ready to redesign the database if anyone has new idea ...
It would be great if you help me on this.I am struggling to find the way for this ...
Can anyone share me a example .