Xitcod13
Xitcod13

Reputation: 6089

Is storing long text descriptions in database or filesystem better?

I just read an article that claims that storing images on the filesystem is better I wonder what are the advantages and disadvantages of storing text in files (except the whole security issue which i dont have a problem with because the text will be public)

I would assume that its still better to store the text in the database. (the text is just a description of an image or some directions that other people should follow)

Upvotes: 0

Views: 1424

Answers (2)

cypherabe
cypherabe

Reputation: 2603

what mvds said, plus there are a few more factors to think about:

  • will you need to search for / in the text descriptions? if yes -> db
  • will there be a demand for a fulltext index? if yes -> db
  • seperate storage adds a level of complexity - file storage (i.e. folder structure) and DB must be kept synchronized

If performance is not the all dominating factor, IMHO db storage is to be preferred for text content. On the other hand, if the text is already "compiled" into a word/pdf/libre office/... document, a lot of the advantages of db storage is lost and file storage may be more desirable

Upvotes: 2

mvds
mvds

Reputation: 47114

Some people argue that performance is better for files vs. database. This depends on a lot of factors.

Other people argue that simplicity/maintainability is better for database vs. files. Think of backups, database replication and such. Having both a filesystem with data, and a database to take care of, is more work.

This question can only be answered if you have a clear picture of all relevant factors.

Upvotes: 2

Related Questions