Non relational database modelling | Sololearn: Learn to code for FREE!

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.

7/24/2021 1:36:50 PM

Mr Robot

7 Answers

New Answer

+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.

+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.

+1

Assign a default for collection_id property

0

Kirabo Ibrahim i want users to make as many as collection they want their selfes to categroise their posts on their profile.

0

Kirabo Ibrahim Thanks for your advice bro

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

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.