I\'m writing a php application and was wondering if it\'s a bad idea to store complete files in the database. Files should be around 100-200kb mostly text files (txt, doc, d
No need to worry about write permissions on the file store.
No need to try and synchronise files on filestore with rows in the database, avoiding orphaned files or broken links. For instance, you can automically cascade delete files when related content is deleted.
In certain databases (such as Oracle and SQL Server) you can index files and search within them using SQL
No need to worry about unique filenames, folders and it can make uploading simpler in some cases
Easier to protect access to files so only authorised users can see them
Disadvantages:
Performance of serving files often suffers compared to filestore
Can lead to large databases. Care needs to be taken when selecting binary columns.
More work to link to files and serve the contents - you need specialised handlers etc.