It's recommended to store file into a directory on web server. Why not use a BLOB
data type for a column where store files? There are security and consistency advantages and it's easier to manage files doing that. What are the cons?
2 Answers
The main reson is that space and performance hit can be quite big and database storage is usually more expensive than file system storage. Here is an excellent resource discussing it.
Also this SO thread has everything there is to this debate

- 1
- 1

- 13,354
- 7
- 49
- 68
-
1link does fail. can you correct it? – javanoob Dec 14 '16 at 11:17
-
@javanoob fixed link – Tony Vincent Dec 14 '16 at 11:23
It's recommended to store file into a directory on web server
Not always - besides the fact this simply does not apply in cases where there is no web-server (e.g. internal native applications).
Why not use a BLOB data type for a column where store files?
It depends on your application's scale and use-cases. What do these blobs represent? Will they be updated regularly? Is there any opportunity for caching or a distribution system?
There are security and consistency advantages and it's easier to manage files doing that. What are the cons?
Performance is the main reason. Reading from a database is generally always slower than reading from disk because of overheads introduced by the DBMS. Writing is also considerably more expensive because of the internal storage layout inside the database system.

- 141,631
- 28
- 261
- 374