title: Database for chat
body: <p>I'm trying to create a chat for a site and I'm wondering if the db solution is the best one in case of a large amount of users.</p>
  
  <p>In case the db is an acceptable solution I would like to know which is the best way to design it:</p>
  
  <ol>
  <li><p>Is one table enough to store all the messages from all the users? Do I have to store each message everytime a user send it (like a simple "hello" in one record)?</p></li>
  <li><p>Do I have to create a separate tables for each chat?</p></li>
  </ol>
  
  <p>Obviously assuming that the indexing and the partitioning are made.</p>
  
  <p>I'm scared about the performance at this stage (db level). Then I can concentrate better to the middleware section and manage it there.</p>