User messaging system design help
I am designing a website in which users can send messages to one
another. Each user will have a mailbox where they can read their
incoming and outgoing messages and delete them if necessary. Anyone
have suggestions on the optimal way to design the database for such a
system?
Re: User messaging system design help
ryan wrote:
> I am designing a website in which users can send messages to one
> another. Each user will have a mailbox where they can read their
> incoming and outgoing messages and delete them if necessary. Anyone
> have suggestions on the optimal way to design the database for such a
> system?
table message:
- id int unsigned primary key auto_increment
- sender_id int unsigned
- receiver_id int unsigned
- subject text
- message text
+ other fields you might require
Index to both sender_id and received_id and it should work pretty fast