1) It depends - but in my experience most enterprises spend more money/time
on data backup/restore than webserver backup/restore. This dependon your
company of course. I don't find it any harder to restore files than data
however - and with the data you've got referential integrity helping out to
ensure that you've got everything you need as well.
2) You might want a file server - but now you've added another piece of
hardware and its associated issues. To me having a file server or serving
the file from the DB doesn't have much of a difference. Either solution
will work fine - but with the DB you have some other benefits.
3) It depends on your infrastructure completely. In many enterprises web
servers, being "public" are in the DMZ and are not accessible by any
internal machines (and are SEVERELY limited in what internal machines they
can access). Data servers on the other hand are almost always maintained in
a more protected area (the "Bastion") and can be accessed by the DMZ (within
strict limits) and the internal network.
In other words in most enterprises a file path is the least of your worries
- it's getting the firewalls cooperating.
Like I said - all of this depends on your architectures. In general however
I consider most files like this "data" and so should be in the database.
That's an opinion however.
But don't minimize the benefits from having referential integrity maintained
automatically. A DB with a file path can't stop somebody (or something)
from deleting a file. If that file were in the DB (and the proper rules
were set up) you can, very easily.
Still it all depends on circumstances.
Jim Davis
_____
From: Calvin Ward [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 5:50 AM
To: CF-Talk
Subject: Re: File Storage - Database vs. File System
For 1, isn't it often simpler to restore single files than it is to restore
single rows?
For 2, ideally, even if you are storing the file path in the db, wouldn't
you want that file to exist in one place only and have the cluster access
the 'file server'?
For 3, wouldn't that be a non-issue if the file path is stored in the db? In
that case the db knows where the file is and can be used to reference the
file regardless of application.
- Calvin
----- Original Message -----
From: Jim Davis
To: CF-Talk
Sent: Wednesday, December 10, 2003 11:25 PM
Subject: RE: File Storage - Database vs. File System
The nice thing about storing the file in the DB is that all your data is
maintained in one place. This has many benefits some of which are:
1) One data store, one clean backup, one clean restore.
2) No issues with cluster redundancy: the file is only stored in one place
regardless of whether 1 or 20 servers use it.
3) The data can be leveraged for more than CF if need be.
4) You can leverage the databases built in referential integrity to great
effect.
That being said this does (among other things):
1) Place more stress on your DB environment. This can also depend on the
types of files - are we talking small photos for photo IDs or 100 megabyte
video files?
2) Make for more complex application code (although as always - build it
right and it won't be complicated).
3) Use more (potentially very expensive) storage on the DB.
4) Potentially make your application slower.
I've generally found that storing the information in the DB is great - but
in use can be slow. So when performance counts and storage isn't an issue
I
store the information in the database and cache the file on the web server
for use. The code first checks to see if the file exists and is the same
date as the file in the DB - if not it pulls it form the DB and writes it
to
the web server.
You can choose not to cache or handle the cache in any way you like - but
if
you've got the space the cache gives you best of both worlds.
Jim Davis
_____
From: Jeff Chastain [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 10:11 PM
To: CF-Talk
Subject: File Storage - Database vs. File System
I am working on an application where the user will have the option to
upload
files to the server. The project specifications are open in terms of
storage of the files, so I am wondering .... what are the benefits or
downsides of storing a file in the database vs. storing it in the file
system? I have in the past stored files in a file system and used
cfcontent
to push the file back to the user, thereby hiding the file structure to
the
end user. However, this always runs into issues with duplicate file
names.
Suggestions?
Thanks
-- Jeff
_____
_____
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- File Storage - Database vs. File System Jeff Chastain
- RE: File Storage - Database vs. File System Jeff Garza
- RE: File Storage - Database vs. File System Jim Davis
- Re: File Storage - Database vs. File System Calvin Ward
- Jim Davis