473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Storing Documents and Images - In the database or as a link?

Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?

What are the general thoughts when a database needs to manage a lot of pdf
and word documents?

Thanks in advance.

Dave.
Jul 20 '05 #1
3 2921
nib
inline...

Dave Smithz wrote:
Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.
Depends on what your situation warrants.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.
Either works. Both have pros and cons.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.
You can automate the storage/retrieval of the documents even if they're
stored in a directory instead of the database.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?


Personally, I lean towards using the database for storage. A quick list
of why:

1) Store multiple documents for the same entity without having to create
naming standards
2) Security
3) only allows editing via your applications

cons:

1) requires additional programming on your end due to dealing with blobs
2) takes more db space (but, you'll be taking up the space anyway)

Zach
Jul 20 '05 #2
Dave Smithz (SPAM FREE WORLD) writes:
Being quite new to MS-SQL I would like to ask if there is a general
opinion of what approach should be taken to storing things like external
documents and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored
instead.


Many people advocate storing files on disk and only store the links in
the database. Undoubtedly, this solution is a lot simpler to implement,
since to store the documents in the database you need to use the image
datatype which is not very simple to work with.

But if you store files on disk, you don't have the consistency check that
transactions buys you. You may store a link in the database, but the
file is for some reason not stored on disk or vice versa. And if someone
uses the Explorer to search the directory, he might delete files by
accident or malice. Of course a malign intruder may delete data in your
database, but you are probably safer to accidents.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
If you store them in the database you know for sure where each one is.
If you store the path, people can move the files and then your
database is kinda useless.

On Mon, 25 Oct 2004 20:49:31 +0100, "Dave Smithz" <SPAM FREE WORLD>
wrote:
Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?

What are the general thoughts when a database needs to manage a lot of pdf
and word documents?

Thanks in advance.

Dave.


Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: faris_idris | last post by:
Hello, we are using Oracle 9i for client and server and Powerbuilder 8.0.3. We have a database link between two databases, whenever I try to do a simple select, update or insert I get the following...
0
by: wqhdebian | last post by:
It was said the ORA-02085 error result from the mismatch of database name and database link name ,and setting glabal_names=false can resolve . but I want to try the other solution,let global_names...
2
by: Dmitry Duginov | last post by:
Here's a problem -------------------------------------------- set serveroutput on DECLARE CURSOR cur is select ed_no, length(ed_no) as len from listtext@pubdb.world; BEGIN for cur_rec in cur...
1
by: Lothar Armbr?ster | last post by:
Hello out there, this morning I had to get some rows via flashback query. Since my undo retention is just 3h, the undo segments were already aged out. But I have a physical standby database that...
2
by: John A. | last post by:
Hello. I'm trying to have an image (a GIF with transparency) overlayed on certain of several inline images that link to different pages. What I have so far looks right (or right enough) in...
1
by: ntiruhar | last post by:
Hi all, My requirement is to migrate all the data from DB2 database to SQL Server database. Is it possible to create a database link between these two databases. regards, Naren
4
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures...
1
by: holdingbe | last post by:
Hi, How to select data from one table from another database? I have two databases such that Source:=michael destination=aster I login in michael database as scott schema . Now i...
2
by: holdingbe | last post by:
Hi, I get very difficult requirement from my friend. I explain clearly below : I have two databases. Source databases: Flower |__________schema: sample. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.