Mail box db


I’m starting to develop a php mailbox system on my site, my site makes use of phpmyadim (for testing) how would be best to store many messages from many users and allowing the user to pull all there messages fast the database without to much lag?

any ideas?


Assuming you’re just talking about a simple message system, and not trying to act as a MX server…

A message is just text; the to and from are INT’s foreign-keyed to a user table.

This question is better suited to the mySQL forum than the PHP one, as it is about database design.

By lag I think you mean how long it’s going to take for a query to return the results?

The depends on a few things:

  1. How well you designed your schema
  2. Normalization process
  3. Making sure your queries are optimized
  4. Don’t return thousands of rows, setup a pagination system

Thanks for the reply, no it not acting has a MX server i was concerned that the search time checking 100’s of message ids for the user would be a problem and please move to the correct forum.