title: How to create a DB design for chat feature?
body: <p>We need to create a chat feature in our web app based on spring MVC. </p>
  
  <p>There will be two kinds of chat one-to-one chat and group chat. </p>
  
  <p>For group chat I have come up with following schema. </p>
  
  <pre><code>Table = group_chat 
  
  User_id, message, message_on (datetime), group_id
  </code></pre>
  
  <p>I am not sure of the one-to-one chat though. </p>
  
  <p>One to one chat may happen outside of a group or within a group between two group members. </p>
  
  <p>Please help</p>