User messaging system design help

User messaging system design help

am 10.07.2006 06:09:26 von Ryan

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

am 10.07.2006 14:36:41 von Aggro

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