Non relational database modelling | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Non relational database modelling

Hello guys i want to make an web app in which user can upload different posts on the site. I want to design a good data structure for this approach. So far my design look like this Collections. Id Users. User_id. UserName,age User_id Posts. Post_id. PostImage, User_id Post_id In this structue every post have its associated user id. Is this is a good structure or did i have some better option? Also in this app user can also make different collections to make categories of different posts. I try to think but i did not know the appropriate approach for model data in database . Please help me i shall be very thankful to you.

24th Jul 2021, 1:36 PM
Mr Robot
Mr Robot - avatar
7 Answers
+ 2
I think collections is redundant, coz I assume every post has a topic and thus you could categorize based on topic or anything e.g user id For the POST class I think you should include attributes like title, date posted.
24th Jul 2021, 1:45 PM
Kirabo Ibrahim
Kirabo Ibrahim - avatar
+ 1
Ok, Then collections would deserve to be another entity, and when a user creates a post, you could (optional) prompt him to assign which collection it may belong or allow him to categorize them later in their profile. POST class may have a collection_id property.
24th Jul 2021, 1:55 PM
Kirabo Ibrahim
Kirabo Ibrahim - avatar
+ 1
Assign a default for collection_id property
24th Jul 2021, 1:56 PM
Kirabo Ibrahim
Kirabo Ibrahim - avatar
0
Kirabo Ibrahim i want users to make as many as collection they want their selfes to categroise their posts on their profile.
24th Jul 2021, 1:50 PM
Mr Robot
Mr Robot - avatar
0
Kirabo Ibrahim Thanks for your advice bro
24th Jul 2021, 2:38 PM
Mr Robot
Mr Robot - avatar
0
Kirabo Ibrahim https://unsplash.com/@rajabbarack/collections please visit this link.i want the same structure a user can upload photos and make as many collection of its photos
24th Jul 2021, 2:40 PM
Mr Robot
Mr Robot - avatar
0
According to this, permissions have been set for certain actions and data. A guest is allowed to read certain data, and to me I don't think rajabbarak will have the same info when he logs in to his account. A collection is associated to tags probably given by the user to enable easy search.
24th Jul 2021, 3:34 PM
Kirabo Ibrahim
Kirabo Ibrahim - avatar