Database design for email messaging system

后端 未结 9 882
情书的邮戳
情书的邮戳 2021-01-29 22:58

I want to make an email messaging system like gmail have. I would like to have following option: Starred, Trash, Spam, Draft, Read, Unread. Right now I have the below following

9条回答
  •  日久生厌
    2021-01-29 23:53

    If you're doing document-orientated work, I suggest taking a look at CouchDB. It is schema-less, meaning issues like this disappear.

    Let's take a look at the example: A sends a message to B, and it's deleted by B.

    You would have a single instance of the document, with recipients listed as an attribute of the email. As users delete messages, you either remove them from the recipients list or add them to a list of deleted_by or whatever you choose.

    It's a much different approach to data than what you're used to, but may be highly beneficial to take some time to consider.

提交回复
热议问题