databasedatabase-designdatabase-connection

Database schema of messaging application


In my messaging application, The features I want to provide are:

My database schema is like this My database schema

This schema is able to provide all the functions above but getting the message out from this kind of schema in groups of users is very complex. Can anyone suggest me some better schema??

The unnamed table is of receivers mapping, forgot to write the name in jpg. :(


Solution

  • What is wrong with one table?

    message_id timestamp to from subject body attachment_pointer origin

    ...

    I'll probably get thrashed for it but... hmm...good point

    Messages
    message_id
    timestamp
    subject
    body
    attachment
    
    MessageReference
    mr_id
    message_id
    to
    from
    

    edit: Also found these:

    Messaging system database schema

    thread messaging system database schema design

    How should I setup my database schema for a messaging system complete with attachments?

    Database schema for messaging to multiple users