Jump to content

Database Design - Email Like Application


redbrad0

Recommended Posts

I am trying to build a web based email like application and I can not seem to get my head wrapped around the best database layout. Below I have some of the basic ideas of the database. There will not be multiple folders that emails can be stored in, but more of just a inbox and outbox. I would like to be able to Reference which emails responses are from so that is why I have the ParentMessageID (Used really for the outbox). What if the email is sent to more then one email address, would I store them all in the column or would it be better to link another table with the email address's? Can anyone see anything I am missing? Sure doesn't seem like I have everything.

 

Messages
Message_ID
Message_ParentMessageID
Message_Subject
Message_Body
Message_DateTime
Message_From
Message_To
Message_CC
Message_BCC
Message_Folder enum('Inbox','Outbox')

Message_Attachment
MessageAttachment_ID
MessageAttachment_MessageID
MessageAttachment_FileName
MessageAttachment_FileNameSaved
MessageAttachment_FileSize

Link to comment
Share on other sites

  • 2 weeks later...

Sounds like you answered your own question.

 

1 Email -> 5,000 people should store:

 

The email,

The fact that it was sent (successful|failed) to 5,000 people.

 

Table Person (

Id

.

.

)

 

Table Email (

  Id

  Originator_Id -- Person.Id (index here.)

  Content

  Attachments

)

 

Table Sent_Email (

  Recipient -- Person.id

  Email -- Email.Id (index here.)

  Status -- 0 success, 1 fail, 2 unkown

)

Link to comment
Share on other sites

  • 1 year later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.