I do have to disagree with a database "being a poor choice" to support documents and images. At best, I'll agree to say "It Depends" but even that bothers me a bit, in this case.
I have more than 10 years of telephone call recordings stored as "Type 4" WAV files ("Type 4" is our acronym for a whole bunch of words that describe the compressed storage method. Most of the ~2TB database exists in a single partitioned table that contains these recordings. All of the rest of the stuff (call metadata, etc), takes just a couple of MB.
When I first reported to the company, I was aghast at the idea of storing such things in a database as most of my constituents across the world will likely be. The thing is... NO ONE will take care of data better than a DBA.
When I started working on using only file references, I actually found the table that did contain 1 file reference per wav file... 10% of the files were corrupt, 10% of the files were totally missing, and nearly 40% of the files had been moved to different directories. That's when I decided to continue to keep the WAV files in an SQL Server table. It also gave me impetus to do what should have been done from the git and partition the table. My full backups of the system vary from less than a minute at the beginning of a month to something less than 12 minutes at month end instead of the more than 10 hours it used to take 5 or 6 years ago... and I've not deleted any of the calls and the recorded call volume has increased almost 10-fold per month. There are some pretty easy methods for pulling all of this off and I've never lost a call file like they have on the file system.
So, bottom line is, "It Depends", as always. What I hope I've done is to provide food for thought that's quite a bit contrary to the typical/purported "Best Practices" recommendations and an example of where they actually sucked... a lot!
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
"If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
"Change is inevitable... change for the better is not."
When you put the right degree of spin on it, the number 3|8
is also a glyph that describes the nature of a DBAs job. 😉
How to post code problems
Create a Tally Function (fnTally)