title: Is a good idea to store chat messages in a mongodb collection?
body: <p>I'm developing a chat app with <code>node.js</code>, <code>redis</code>, <code>socket.io</code> and <code>mongodb</code>. MongoDB comes the last and for persisting the messages. </p>
  
  <p>My question is what would be the best approach for this last step? </p>
  
  <p>I'm afraid a collection with all the messages like</p>
  
  <pre><code>{
      id,
      from,
      to,
      datetime,
      message
  }
  </code></pre>
  
  <p>can get too big too soon, and is going to get very slow for reading purposes, what do you think? </p>
  
  <p>Is there a better approach you already worked with?</p>