If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Complex / confusing model design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-11, 19:34
NeglectedGoldfish NeglectedGoldfish is offline
Registered User
 
Join Date: Jul 2011
Posts: 1
Complex / confusing model design

Hi,

After a lot of reading and trawling around the net, I've arrived here for some assistance with a detabase model I can't get my head round.

In a high-level sense, it sounds quite simple. But when I try and build something tangible, I get lost in my own confusion.

Here is a simplistic description of the requirements:

1) A database is required to let users share items of information with each other.
2) Each user can have share say a joke, a youtube video link, a recipe etc.
3) A user can choose what he shares with other users. E.g. he may want to share the video link with one user, but not another.

Assumptions:
1) The list of possible share-able items my change, but quite infrequently.
2) The share-able content can be stored in one field

Data access requirements:
1) A user should be able to see everything that everyone has shared with the
2) For each shared item, a user should be able to see who he has shared it with
3) A user should be able to change what he shares with each other user

I've worked with many e-commerce systems over the years, and I almost immediately thought of something like the EAV model. However, I wasn't sure how to implement access control, without several additional tables.

Access to the data is just as important as the ability to store the data, so again, with performance concerns, I was wary of EAV.

I have also considered a simplistic flat(er) table approach.

Any help with this would be fantastic. If I can provide more information, please ask.

Thanks,

Fish
Reply With Quote
  #2 (permalink)  
Old 07-19-11, 21:04
BrianSteffens BrianSteffens is offline
Registered User
 
Join Date: Jul 2011
Posts: 14
Hmm, how about something simple like:

Code:
Users table - stores all users

ID         Username
1           user1
2           user2
Code:
Content table - stores all content, OwnerID indicating the user who owns the content

ID         OwnerID          Content
1           1                    ***
2           1                    ***
3           2                    ***
Code:
Share table - connects one content item to a user (so user1 is sharing content ID 1 with user2 and user2 is sharing content ID 3 with user1)

ContentID         UserID
1                     2
3                     1
Is this close to what you're looking for or are there more requirements?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On