Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011

    Complex / confusing model design


    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.

    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.



  2. #2
    Join Date
    Jul 2011
    Hmm, how about something simple like:

    Users table - stores all users
    ID         Username
    1           user1
    2           user2
    Content table - stores all content, OwnerID indicating the user who owns the content
    ID         OwnerID          Content
    1           1                    ***
    2           1                    ***
    3           2                    ***
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts