Hi guys,

I am coding a chat script right now and I was wondering if it is better to use a MySQL database for the chat messages or to use flat file performance wise.
I will be polling for new messages every second so a little performance improvement goes a long way.

Please advise.

    Database, you'll have lots of scary locking issues with a flat file, plus if the chat gets long/file gets large... flat files will most likely be slow.

      By saying flat files I mean I am going to store the chat as a serialized array so that I wont have to spend too much server resources to parse it.
      Does it still make more sense to use DB in this case? Is the overhead lower to fopen a file then to connect and retrieve values from a database?

      Thanks in advance for shedding some light!
      🙂 🙂

        Write a Reply...