I am working on project -online file management where we have to tore file and images.so we are in confusion state that whethe开发者_运维技巧r we use file system or database to store file and images;;;;;
An usual approach is to store big binary data (e.g. images) in files, and put pointers to them in a database. This way the best of both worlds can be combined (to a degree, at least); file system's efficiency of file storage, and database's search / sort / lookup capabilities.
Keep your files out of the database. Create a record in the database like so:
primaryKey FileName FileDescription OnDiskKeyName
------------ ----------- ------------------- -----------------
use a UUID to give a unique name to the file, and a link to the database with a human-readable name.
精彩评论