Link to home
Start Free TrialLog in
Avatar of Imran Ali
Imran AliFlag for Pakistan

asked on

Help With Simple Database Design

I need to get some idea on designing database schema. Basic entities are:
Users
Content
Categories

Main function:
Users can create & store different type of content i.e Text, Documents, Events, Calenders, Forms.

Content may be password protected.

Just wanted to know if I need to create separate tables to store different content types.
i.e Documents, Events or it can be done with single table?

Any good approach?

Thanks.
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Just wanted to know if I need to create separate tables to store different content types.
i.e Documents, Events or it can be done with single table?
it depends on how you define your contents, if different contents come with different attributes (fields) to be stored, it's better to normalise it, which means to store the contents in different tables.
You have added MySQL server and MongoDb Topic Areas to your questions. These databases use completely different methods of storage and retrieval. MySQL is a relational SQL based database MongoDb is a NoSQL document based database.

Before giving you assistance with design you need to decide which one you are going to use.
Avatar of Imran Ali

ASKER

I am working on MySql server MongoDB was added automatically.
How many categories and how likely are they to change.
User can add as many categories but there are some category types to be selected.

Pre-defined types are:
Text
Documents
Events
Calenders
Forms
Notifications

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just wanted to know if I need to create separate tables to store different content types.
i.e Documents, Events or it can be done with single table?
You can do it with a single table. I would not store docs / images in the database - store them on disk and put the path to the file in the db.