[Tutor] File storage vs DB storage.

Alan Gauld alan.gauld at btinternet.com
Tue Apr 10 12:10:05 CEST 2007


"OkaMthembo" <zebra05 at gmail.com> wrote

> Ok, to get to the point: when building a web app that should store 
> an
> retrieve photos, what would be more efficient between the app 
> storing the
> files on a local hard disk, or saving blobs/ binary data to a 
> database?
> Someone toldme that database storage should be avoided as it
> would cause a botleneck,

I wouldn't say a bottleneck but it can cause problems by
making the database itself very big. That can cause
problems for some operations, including admin tasks.
Some databases work better with blobs than others.

> whereas i dont want to imagine the nightmare of managing
> tons of files sitting in a folder. I use Windows XP.

Naming issues are usually the biggest problem.
It will work best if you use a numrerical naming convention
and manage all of the meta data in the database, along
with the filename.

The advantage of using the file system is that you can
use different folders to help organise the files - folders for
month created or submitter or whatever. Also you can
use the facilities of the OS to create encrypted folders,
secure folders, compressed folders, move the folders
onto other drives as the capacity expands, do incremental
backups etc etc.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list