title: File vs database for storage efficiency in chat app
body: <p>I'm working on a simple AJAX chat add-on for my PHP application so I can provide real-time support to my users.  I'm currently using a MySQL database storing the text, timestamp and user_id of the person who is chatting.  I got to thinking about how I could optimize my chat and I got to thinking about removing the need for the SQL database.</p>
  
  <p>My question, would it be more efficient to use <code>fwrite()</code> to append extra data to a PHP file to store the same information rather than creating an SQL connection to retrieve new posts to the chat?  I know how I would accomplish this effectively, I'm just trying to figure out which way would be more efficient.</p>
  
  <p>I've looked a little bit at SQLite as well; would that be a better alternative than using a MySQL database?</p>