Question

I'm about to develop a sort of messaging system for a portal in which users will be able to communicate privately, each conversation will be about a single "topic" and at the end every conversation should be "closed". every user could have different conversations with different users about the same topic. so at the end there should be lot of conversations for every user. conversations will be not editable once sent to the recipient.

I was wondering if it is better to store those conversation in files, in which each time I append new messages, or if it better to store them in the mySQL.

Are there some drawbacks in one of the solutions? Does anyone has already had some experience about similar situations?

Was it helpful?

Solution

I would recommend against filesystem:

  • You cannot access it from multiple webservers
  • Databases allow you easier to store also some metadata, e.g. date of message send
  • Making your filesystem backups consistent with the database backups could be complicated

If you care about size you could consider to compress your data before putting them into the database and uncompress it after reading from the database.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top