Connecting Tech Pros Worldwide Forums | Help | Site Map

store image in DB or in file

clark
Guest
 
Posts: n/a
#1: Nov 17 '05
I have an app that needs to upload images for each active
member. Which is the best approach?
1. to store the img directly in SQL Server database
or
2. to store path/filename in db and put file on server

volume is potentially 10,000+ images



Steve C. Orr, MCSD
Guest
 
Posts: n/a
#2: Nov 17 '05

re: store image in DB or in file


The answer is "it depends."
It depends on all kinds of things such as hardware, infrastructure, number
of users, peak loads, scalability requirements, etc.
Certainly storing the files in SQL Server is easier because you don't have
to worry about file management issues, such as naming conflicts, and files
being deleted, moved, etc.
Here's a good tutorial on the subject for you:
http://www.aspnetpro.com/features/20...200307so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


"clark" <clark@speakeasyinteractive.com> wrote in message
news:024f01c35606$d96c6ce0$a401280a@phx.gbl...[color=blue]
> I have an app that needs to upload images for each active
> member. Which is the best approach?
> 1. to store the img directly in SQL Server database
> or
> 2. to store path/filename in db and put file on server
>
> volume is potentially 10,000+ images[/color]


Steve C. Orr, MCSD
Guest
 
Posts: n/a
#3: Nov 17 '05

re: store image in DB or in file


This is true to some extent.
But keep in mind that Microsoft's next Windows file system is based on SQL
Server.
So soon you'll essentially be storing all your files in SQL Server whether
you want to or not.

Even so, the decision still basically comes down to App Performance vs.
Development Time.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


"Kevin Spencer" <kevin@takempis.com> wrote in message
news:%23L2$EAhVDHA.208@tk2msftngp13.phx.gbl...[color=blue]
> Storing in the file system will be less costly, as storing and retrieving
> binary data from a SQL Server is much more costly in terms of performance
> than storing and fetching files from the file system.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Complex things are made up of
> lots of simple things.
>
> "clark" <clark@speakeasyinteractive.com> wrote in message
> news:024f01c35606$d96c6ce0$a401280a@phx.gbl...[color=green]
> > I have an app that needs to upload images for each active
> > member. Which is the best approach?
> > 1. to store the img directly in SQL Server database
> > or
> > 2. to store path/filename in db and put file on server
> >
> > volume is potentially 10,000+ images[/color]
>
>[/color]


CT
Guest
 
Posts: n/a
#4: Nov 17 '05

re: store image in DB or in file


I agree with your view points, but while waiting for Yukon I think that
because of SQL Servers rather poor BLOB handling, storing images in the file
system is by far the most efficient.

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
news:%23o7DeXiVDHA.1832@TK2MSFTNGP09.phx.gbl...[color=blue]
> This is true to some extent.
> But keep in mind that Microsoft's next Windows file system is based on SQL
> Server.
> So soon you'll essentially be storing all your files in SQL Server whether
> you want to or not.
>
> Even so, the decision still basically comes down to App Performance vs.
> Development Time.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
>
>
> "Kevin Spencer" <kevin@takempis.com> wrote in message
> news:%23L2$EAhVDHA.208@tk2msftngp13.phx.gbl...[color=green]
> > Storing in the file system will be less costly, as storing and[/color][/color]
retrieving[color=blue][color=green]
> > binary data from a SQL Server is much more costly in terms of[/color][/color]
performance[color=blue][color=green]
> > than storing and fetching files from the file system.
> >
> > --
> > HTH,
> >
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > http://www.takempis.com
> > Complex things are made up of
> > lots of simple things.
> >
> > "clark" <clark@speakeasyinteractive.com> wrote in message
> > news:024f01c35606$d96c6ce0$a401280a@phx.gbl...[color=darkred]
> > > I have an app that needs to upload images for each active
> > > member. Which is the best approach?
> > > 1. to store the img directly in SQL Server database
> > > or
> > > 2. to store path/filename in db and put file on server
> > >
> > > volume is potentially 10,000+ images[/color]
> >
> >[/color]
>
>[/color]


CT
Guest
 
Posts: n/a
#5: Nov 17 '05

re: store image in DB or in file


That can certainly be an issue, so you have to choose between two
evils...<g>

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Ray Dixon [MVP]" <ray@NOSPAM.greeble.com> wrote in message
news:u77cCR4VDHA.1872@TK2MSFTNGP12.phx.gbl...[color=blue]
> Keep in mind you will have to deal with the possibility (probability?) of
> duplicate file names if you store the files in the file system. In a SQL
> DB, you wouldn't have that issue.
>
> My $.02.
>
>
> --
> Ray Dixon - Microsoft MVP
> ray@NOSPAM.greeble.com
> (remove NOSPAM. from my e-mail address for a direct reply)
>
>
> "CT" <carstent@spammersgowaydotnetservices.biz> wrote in message
> news:uYUzRFzVDHA.532@TK2MSFTNGP09.phx.gbl...[color=green]
> > I agree with your view points, but while waiting for Yukon I think that
> > because of SQL Servers rather poor BLOB handling, storing images in the[/color]
> file[color=green]
> > system is by far the most efficient.
> >
> > --
> > Carsten Thomsen
> > Enterprise Development with Visual Studio .NET, UML, and MSF
> > http://www.apress.com/book/bookDisplay.html?bID=105
> > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
> > news:%23o7DeXiVDHA.1832@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > This is true to some extent.
> > > But keep in mind that Microsoft's next Windows file system is based on[/color][/color]
> SQL[color=green][color=darkred]
> > > Server.
> > > So soon you'll essentially be storing all your files in SQL Server[/color][/color]
> whether[color=green][color=darkred]
> > > you want to or not.
> > >
> > > Even so, the decision still basically comes down to App Performance[/color][/color][/color]
vs.[color=blue][color=green][color=darkred]
> > > Development Time.
> > >
> > > --
> > > I hope this helps,
> > > Steve C. Orr, MCSD
> > > http://Steve.Orr.net
> > >
> > >
> > > "Kevin Spencer" <kevin@takempis.com> wrote in message
> > > news:%23L2$EAhVDHA.208@tk2msftngp13.phx.gbl...
> > > > Storing in the file system will be less costly, as storing and[/color]
> > retrieving[color=darkred]
> > > > binary data from a SQL Server is much more costly in terms of[/color]
> > performance[color=darkred]
> > > > than storing and fetching files from the file system.
> > > >
> > > > --
> > > > HTH,
> > > >
> > > > Kevin Spencer
> > > > Microsoft MVP
> > > > .Net Developer
> > > > http://www.takempis.com
> > > > Complex things are made up of
> > > > lots of simple things.
> > > >
> > > > "clark" <clark@speakeasyinteractive.com> wrote in message
> > > > news:024f01c35606$d96c6ce0$a401280a@phx.gbl...
> > > > > I have an app that needs to upload images for each active
> > > > > member. Which is the best approach?
> > > > > 1. to store the img directly in SQL Server database
> > > > > or
> > > > > 2. to store path/filename in db and put file on server
> > > > >
> > > > > volume is potentially 10,000+ images
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Closed Thread