redbrad0 Posted May 22, 2008 Share Posted May 22, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/ Share on other sites More sharing options...
bholbrook Posted May 22, 2008 Share Posted May 22, 2008 You should treat each email address forwarded to as a seperate email (thus each email will have their own parent_id). This will also allow you to track failed emails on an individual address level. Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/#findComment-547607 Share on other sites More sharing options...
redbrad0 Posted May 22, 2008 Author Share Posted May 22, 2008 I really don't think that would be the best database layout because you are taking some of the biggest fields duplicates. What if I sent a email to 5000 people, should 5,000 copys of the email be inserted into the database Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/#findComment-547716 Share on other sites More sharing options...
redbrad0 Posted June 6, 2008 Author Share Posted June 6, 2008 Nobody has any other suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/#findComment-559233 Share on other sites More sharing options...
keeB Posted June 8, 2008 Share Posted June 8, 2008 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 ) Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/#findComment-560180 Share on other sites More sharing options...
sushant17 Posted May 27, 2010 Share Posted May 27, 2010 hello....guys.......... i too designing emil like application................ i just wanna know where the messages get stored.......... Quote Link to comment https://forums.phpfreaks.com/topic/106814-database-design-email-like-application/#findComment-1064047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.