designing database

anshulnegitc

Anshul Negi

Posted on March 16, 2020

designing database

I am new to database architecture though familiar with queries and aggregation in MongoDB.
At present working on a project where I have to store different user depending upon the type/role. There are few fields similar in the user model, would it be correct to create a separate collection for each role or just create separate schema then reference it i.e only a single collection.
In the future, more roles can be added with more information.
Any other approach is welcome.

Below is the mock models
Eg:
*customer =
{firstname,lastname,email,address,mobileno,password,role}
*sales = {firstname,lastname,email,address,mobileno,password,role,attachments,experience,
education}
*marketting =
{teamName,email,address,mobileno,password,role,members,attachments}

💖 💪 🙅 🚩
anshulnegitc
Anshul Negi

Posted on March 16, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

designing database
mongodb designing database

March 16, 2020