I want to Design an application with MongoDB and NODE. Before Starting I want to ask your opinion about the Database Design.
To have a familiar Example, lets Say this App is like Instagram in which data is categorized in special News Groups like Sport Art Business and Politics.
In this app Users can Upload Pictures which has comments and each Picture should be in an Special News Groups as I mentioned before.
I want to Design my Database as follows. Please tell me your ideas and suggestions.
User: [ Username, Email, Password ]
// Schema for SignUp //
UserData: [ Username, NewsGroup:[ Sport, Politics ], NewsReputation ]
// Schema for Username Home Page which shows each NewsGroup of user in a tab //
News: [ Username, NewsGroupID, Picture:[ Up to 5 ], Description, Video:[Only 1] ]
Comment: [ Username, NewsGroupID, NewsID, Comment: [1 for Each array], Commentor-Username]
Following: [ Username, Following-Username ]
Follower: [ Username, Follower-Username ]
Or I can nest Each News Array as a sub-document inside NewsGroup in UserData Schema
And nest Comment Schema inside News Schema as well.
- Which Approach is better?
- Is it better to use MongoDB or I should go with SQL Databases?
- If I want to have a Search-Page, What do you suggest for that?
I am new to User-Based Websites, So I will appreciate any idea and suggestion.
Thanks!