Obviously, this is to be taken on a case-by-case basis, but I was having a chat with a guy at work the last couple of days and he's convinced that storing files in databases is the absolute best. Personally, I disagree. As far as I can see, there are pros and cons for each, but I can't understand why he's so for it. Am I missing something?
Database:
Pros.
-Secure. Users are unable to peruse your files unless you say they can
-Portable. Don't have to worry about where all your files are if they're right there in the database
-Easier to normalise data
Cons.
-Relatively slow, compared with the filesystem (I would've thought)
-Pointless, unless you need the 2 pros (in my mind)
-Large amounts of database taken up with files would logically slow indexing/searching (this may not be true!)
File system:
Pros.
-It's where your files go!
-Better for dealing with larger files
-Quicker
-Easier to manage physical files - ie. if you just want to switch one of your files, delete, upload, rename and you're done!
Cons.
Basically the pros of database, although some degree of security can be obtained through apache and if you're organised, portability shouldn't really be too much of an issue.
I've had a look around and I can't find anything concrete (mostly people saying "why would you want to store files in the database?!" - not helpful!) - was wondering if people could share their thoughts/preferences on the subject.
Anything in this post is subject to scrutiny - file management isn't a speciality area of mine and I'm very open to persuasion!
Database:
Pros.
-Secure. Users are unable to peruse your files unless you say they can
-Portable. Don't have to worry about where all your files are if they're right there in the database
-Easier to normalise data
Cons.
-Relatively slow, compared with the filesystem (I would've thought)
-Pointless, unless you need the 2 pros (in my mind)
-Large amounts of database taken up with files would logically slow indexing/searching (this may not be true!)
File system:
Pros.
-It's where your files go!
-Better for dealing with larger files
-Quicker
-Easier to manage physical files - ie. if you just want to switch one of your files, delete, upload, rename and you're done!
Cons.
Basically the pros of database, although some degree of security can be obtained through apache and if you're organised, portability shouldn't really be too much of an issue.
I've had a look around and I can't find anything concrete (mostly people saying "why would you want to store files in the database?!" - not helpful!) - was wondering if people could share their thoughts/preferences on the subject.
Anything in this post is subject to scrutiny - file management isn't a speciality area of mine and I'm very open to persuasion!