MySQL Forums
Forum List  »  Quality Assurance

Thousand of users
Posted by: Daniel Brown
Date: October 28, 2007 04:05PM

Hi I have a problem, that I am struggling considerably with I really hope someone knows an answer to this so I can sleep beter ;P

I am building a message system, each user is added into the users table with correct indexing for querying results to login etc, but this is only one row of data.

The problem is what about messages, I mean each user will be able to send messages to every other user and vice versa, so what is the best method to store these messages.

(id, userid, date, time, message, from) would be the colls

I have pondered over creating seperate tables for each user and then storing messages into each users table but was advised against this, as I would end up having thoudands of tables. But is this really a bad thing?

How could I have one table with potentially millions of messages and then run a query such as select all messages for userid? I mean I am guessing this would create problems with access speeds if many users are doing this at the same time?

I really am stuck with this database layout problem......

Please help me sleep again....

Kindest regards,
Daniel



Edited 1 time(s). Last edit at 10/28/2007 04:13PM by Daniel Brown.

Options: ReplyQuote


Subject
Views
Written By
Posted
Thousand of users
2718
October 28, 2007 04:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.