Storing images using BLOB vs direct to web server [duplicate]
Possible Duplicates:
To Do or Not to Do: Store Images in a Database Storing Images : DB or File System -
Hello everybody I need to implement image storage in a web applicatio开发者_StackOverflow中文版n so have the following question:
When saving images I have 2 choices using blobs or saving the image directly onto the web server. In other words using the DB server to store the whole amount of pictures which is going to be the core business (processing images) vs letting the web server stores them.
Performance is going to be better from the web server side because I do not have to be querying the DB to retrieve images, just the path. On the other hand using the DB is a better choice because of Storage space; but I do not know which choice is better.
I want to have some idea which of those is the best practice. If you have any advice please let me know. Thanks in advance.
I vote for files. The storage space of files in DB is more than a pure file. Access to files may 10 times faster. You can backup files with rsync and secure them with OS file options.
In the case of Web Applications the common practice is to store image files on the File Server (preferably dedicated) so that they could be accessed by client-side scripts, CSS and mark-up without a need to connect to database.
精彩评论