I'm attempting to design and build a data structure for a blogging platform.

the business of my website follows

  1. users can create articles.

articles must include one of predefined generic category, and allow many custom_tags

  1. users can comment on articles

user is able reply to other users.

  1. users can like comments/articles.

  2. users have a public profile.

includes basic public information i.e. title, primary_color, description

  1. users have preferences/presets to miscellaneous feature for the front-end.

i.e. dark mode, tags that users are following.

Currently this is what I have at the moment. Not sure, if im doing this in the correct manner. It would help greatly if i can get some guidance.

This is the current structure

there a few things come to mind:

  1. Do i need to add a new PK for each table that extends from users that has a one-to-one relationship, i.e. user and user_profile or user and user_preference.

  2. I'm thinking that each articles categories itself from one or two listed within global_predefined_categories. I'm not so sure how to map that in tables... While custom tags can be many as 10.

  • Rather than having a one-to-one relationship between two tables, use a single table. Nov 17 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.