one of my customer ask for a Document Management System for some thousands of document in different format i.e. pdf, doc, docx etc. My question is what is the best way to store this file in database or in file system? How easy to secure a document between the two approach?.
Fast retrieval of the files is the key requirement..
am using mysql if that helps
Regards.
In my own experience, it is always better to store files as files. The reason is that the filesystem is optimised for file storeage, whereas a database is not.
Data sharing: The file system does not allow sharing of data or sharing is too complex. Whereas in DBMS, data can be shared easily due to a centralized system. Data concurrency: Concurrent access to data means more than one user is accessing the same data at the same time.
Storing files in the database slows down overall query performance simply because there is more data transmitted between the application and the database. Additionally, files use up RAM which is used internally by the database to improve performance.
A File System is a collection of raw data files stored in the hard-drive, whereas a database is intended for easily organizing, storing and retrieving large amounts of data. In other words, a database holds a bundle of organized data typically in a digital form for one or more users.
You might want to store it directly into filesystem.
When using filesystem careful with :
If you need to search for these documents (date/title/etc...) you may want to store metadata into a database for better performances.
FYI, in this question MS SQL Server has FILESYSTEM column type (like an hybrid), but at the moment MySQL doesn't have an alternative.
Using filesystem access for big datablobs means in general faster access and less overhead than storing them in a mysql database.
One interesting and possibly related post: Storing Images in DB - Yea or Nay?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With