Storing images, documents etc in a database
-
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
-
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
jgrogan wrote:
haven't found any useful information on Google
Then you are blind, this question is asked at least once a month (if not more often), has been answered with 1000s of excellent articles. Google search works just fine for me[^]. CP article search will give you some excellent articles.
Never underestimate the power of human stupidity RAH
-
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
I have searched good article from code project to kick end your problem, These articles is neat and really helpful. Articles by sacha[^]
Aritcle by Kazim[^]
Article by shabdar[^] It may help you to be familiar with that aspect.Regards, Hiren.
My Recent Article: - Way to know which control have raised PostBack
My Recent Tip/Trick: - Remove HTML Tag, get plain Text -
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
-
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
Yup Mycroft,Hiren and Makr already given you some link for best article over how to save image int database. you can also download the given sample code to learn how to store and retrieve image from SQL server. Click on the given link to Download Sample Codes[^] Hope it will works for you.
-
Yup Mycroft,Hiren and Makr already given you some link for best article over how to save image int database. you can also download the given sample code to learn how to store and retrieve image from SQL server. Click on the given link to Download Sample Codes[^] Hope it will works for you.
Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.
-
Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.
-
Guys, Thanks for taking the time to point me at some good articles. Does anyone have any thoughts on storing documents (pdf, xls, doc) etc in a database and how to do it. The only suggestion I've found is to store them in o/s file structure and use the database to store path and some info. What would be the pros / cons of using a DB rather than the O/S? Thanks, John.
jgrogan wrote:
oes anyone have any thoughts on storing documents
Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.
Never underestimate the power of human stupidity RAH
-
jgrogan wrote:
oes anyone have any thoughts on storing documents
Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.
Never underestimate the power of human stupidity RAH
-
Can I assume that the same issues apply to Oracle and mySQL? What about distributed databases such as Cassandra? Does anyone have any experience of that?
jgrogan wrote:
Can I assume that the same issues apply to Oracle and mySQL?
Absolutely NOT each database will have it's own issues and methods. You are moving into a more esoteric area of data storage and all of them will treat it differently. I only have (relevant) experience with sql server.
Never underestimate the power of human stupidity RAH
-
Guys, I'm relatively new to using databases and have been playing around with SQL Server 2005 to do some stuff. However, I'm looking at extending an application that uses images and documents (mainly pdf) and I want to be able to store these somewhere (ideally in a database). I haven't found any useful information on Google, so wanted to ask others for their suggestions on how to do this. It doesn't have to be on SQL Server and I can basically use any db that's up to the task. Thoughts welcome, John.
If there is any chance that this could move to SqlServer 2008, you might consider FileStream Storage[^].
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
jgrogan wrote:
oes anyone have any thoughts on storing documents
Now thats a different question, why not how, much more interesting. As with anything there are a number of pros and cons, they will depend on your requirements, your hosting environment, the cost of maintenance and infrastructure. Basically 3 styles of storage (using sql server). 1. Files stored in file systems with path in the record. 2. Files stored as binary data in the record 3. Files stored in a database managed file store. 2 means the database may grow dramatically affecting the cost of backup 3 allows you to split the backup to exclude the images (option) reducing backup cost. Then there is the whole discussion around access of the files, 1 requires file management 2 & 3 require database operation. Having used all 3 I still go for 1 as the most widely used and understood. Do not take this as definitive, you need to do some research and balance that with your requirements and budget.
Never underestimate the power of human stupidity RAH
I agree here... I prefer #1 in just about every case. I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed. Sure, I would guess that you can gain some backup and restore simplicity but I just don't see that as being a real benefit. Now, it would be cool if you could use a type of image bassed query engine on a DB full of pictures... that would be really neat.. IE: fed in a picture of a particular bird and get back a record set of pictures containing that type of bird, or similar birds with that colorization or marking pattern... but I suspect that would be VERY difficult and not very efficient really. Would still be neat though. I always wanted to try to write a function that you could feed in an image and a folder and have it search through all the images and see if your input image was a subset (IE: copied section) of one of the images in the source folders...
-
I agree here... I prefer #1 in just about every case. I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed. Sure, I would guess that you can gain some backup and restore simplicity but I just don't see that as being a real benefit. Now, it would be cool if you could use a type of image bassed query engine on a DB full of pictures... that would be really neat.. IE: fed in a picture of a particular bird and get back a record set of pictures containing that type of bird, or similar birds with that colorization or marking pattern... but I suspect that would be VERY difficult and not very efficient really. Would still be neat though. I always wanted to try to write a function that you could feed in an image and a folder and have it search through all the images and see if your input image was a subset (IE: copied section) of one of the images in the source folders...
Ray Cassick wrote:
I just never makes sense to me to store the actual images or documents in the DB itself since it really provides you nothing in the way of performance or search capabilities and I think really adds more weight to your DB than is needed.
The link I posted does show a performance difference. Additionally a factor could be access control, especially when users are managed as data versus actual db users or system users.