I guess this is a very basic question and must have similar issues, but the truth is that I have found very little information. I am developing a website with multiple types of content: articles, threads, recipes, etc.. All these content types can comment and do "like". Comments may also receive "likes". I am no specialist in database architecture, and how I developed the prototype was to establish different tables: comment_article, comment_thread, comment_recipe ... and like_article, like_thread, like_recipe, like_comment.
Now I want to simplify the structure of the minimum number of possible tables: comments and likes.
I would like to know the most performance efficient way to accomplish this:
- Field content_type, parent_id to specify the type of content and your referral id.
- Fields content_type, thread_id, article_id, recipe_id.
- Any others?
Note: We are using relational database with InnoDB
storage engine.