I’m looking to build a messaging system that handles conversation much like how Facebook does it. I’m wondering what the best way to do that would be in regards to table structure. Would I have one table like:
id reply_id - the id of the original message that started the conversation to_id from_id subject content date_sent read_status
Or two tables:
table 1 - for the start of new messages id to_id from_id subject content date_sent read_status table 2 - when someone replies to a message id message_id to_id from_id subject content date_sent read_status
I’d say one table. Why duplicate identical data? Besides, you will remove a source of error when your message data structure is altered by not having to care about the other table being identical to the first.