开发者

Mail database schema designing

I am trying to design an mail system. I have stuttered on the problem that I have no solution yet, but maybe you can point me to some? My proble开发者_Go百科m is I don't really imagine how does the database schema should look like if we are having two different tables for Inbox and Outbox. In example we also must have Users and Messages tables. So from my point of view I think that Message should have two Foreign key to both users ID's(primary key in Users table) from which we can identify sender and receiver. Afterwards it seems ok, but if we will start thinking that we must identify which of the both users should have this message in Inbox or Outbox? Only thing comes to mind if we will have Message fields like id, sender_id and receiver_id, text and etc. I don't think its a good maintainable design.. In example if we would like to have Message table not only for users conversations but on forum or somewhere else? Please correct me if I am wrong. Any help, suggestions, advices are welcome!


Look at Zimbra for some inspiration. It's open source, and uses MySql to store the message metadata, while the actual messages are stored in the file system.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜