|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Image RecommendationsHi eveyrone. I am writing a client/server application that has to deal with
displaying images to the user. The user will have the ability to add images to entries. Ok im kind of looking for a best practice here on what to do with the images. I am using SQL Server 2005 and i know that i do not want to store the images in blog fields in sql server. That is a definite. What other choices do i have here? Maybe you can binary serialize the image and use either remoting or web services to send the image over the wire and store it in a directory. The directory location would be located in sql server. This seems like a plausable solution but seems quite messy. What other solutions are there? What solution do you think is the best? If i end up doing the solution i came up with then i would have to include that part in the database transaction and it could be asynchronous because if the saving of the image fails i also want to fail the transaction. Just looking for some ideas here guys. I didn't know what other newsgroup would be fitting since this is a general question. Thanks, Brent What is wrong with storing the images in the database? I have written
similar systems without any performance problems. Bryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com Show quote "Brent" <brentwa@spam.hotmail.com> wrote in message news:17181D47-F90B-4C2D-8D84-D190139F3302@microsoft.com: > Hi eveyrone. I am writing a client/server application that has to deal with > displaying images to the user. The user will have the ability to add images > to entries. Ok im kind of looking for a best practice here on what to do > with the images. I am using SQL Server 2005 and i know that i do not want to > store the images in blog fields in sql server. That is a definite. What > other choices do i have here? Maybe you can binary serialize the image and > use either remoting or web services to send the image over the wire and > store it in a directory. The directory location would be located in sql > server. This seems like a plausable solution but seems quite messy. What > other solutions are there? What solution do you think is the best? If i end > up doing the solution i came up with then i would have to include that part > in the database transaction and it could be asynchronous because if the > saving of the image fails i also want to fail the transaction. Just looking > for some ideas here guys. I didn't know what other newsgroup would be > fitting since this is a general question. > > Thanks, > Brent Because of database caching. Unless things have changed with SQL Server 2005
from 2000 anything you retrieve is cached. This is pretty much global to all databases that live on that instance of sql server. Now do you want large images being cached and taking up precious cache space? I think this would be a poor use of sql servers cache space and could possibly really hurt how much your application could scale. I want my cache to only hold non-binary data. I don't want a huge image to wipe out my data cache. Yes im sure in a lot of systems it wouldn't cause a problem but i generally like to follow a best practice senario. Brent Show quote "Bryan Phillips" <bphillips@nospam.crowechizek.com.spammenot> wrote in message news:e7bSpuW%23GHA.4704@TK2MSFTNGP04.phx.gbl... > What is wrong with storing the images in the database? I have written > similar systems without any performance problems. > > > Bryan Phillips > MCSD, MCDBA, MCSE > Blog: http://bphillips76.spaces.live.com > > > > > "Brent" <brentwa@spam.hotmail.com> wrote in message > news:17181D47-F90B-4C2D-8D84-D190139F3302@microsoft.com: > >> Hi eveyrone. I am writing a client/server application that has to deal >> with >> displaying images to the user. The user will have the ability to add >> images >> to entries. Ok im kind of looking for a best practice here on what to do >> with the images. I am using SQL Server 2005 and i know that i do not want >> to >> store the images in blog fields in sql server. That is a definite. What >> other choices do i have here? Maybe you can binary serialize the image >> and >> use either remoting or web services to send the image over the wire and >> store it in a directory. The directory location would be located in sql >> server. This seems like a plausable solution but seems quite messy. What >> other solutions are there? What solution do you think is the best? If i >> end >> up doing the solution i came up with then i would have to include that >> part >> in the database transaction and it could be asynchronous because if the >> saving of the image fails i also want to fail the transaction. Just >> looking >> for some ideas here guys. I didn't know what other newsgroup would be >> fitting since this is a general question. >> >> Thanks, >> Brent > In that case, you will need to wrap both the database update and file
update in a single transaction scope. Since there is no automatic rollback for file updates, you will have to create a compensation to rollback the file changes if a rollback occurs. Bryan Phillips MCSD, MCDBA, MCSE Blog: http://bphillips76.spaces.live.com Show quote "Brent" <brentwa@spam.hotmail.com> wrote in message news:e2luvmf#GHA.4544@TK2MSFTNGP05.phx.gbl: > Because of database caching. Unless things have changed with SQL Server 2005 > from 2000 anything you retrieve is cached. This is pretty much global to all > databases that live on that instance of sql server. Now do you want large > images being cached and taking up precious cache space? I think this would > be a poor use of sql servers cache space and could possibly really hurt how > much your application could scale. I want my cache to only hold non-binary > data. I don't want a huge image to wipe out my data cache. Yes im sure in a > lot of systems it wouldn't cause a problem but i generally like to follow a > best practice senario. > > Brent > > "Bryan Phillips" <bphillips@nospam.crowechizek.com.spammenot> wrote in > message news:e7bSpuW%23GHA.4704@TK2MSFTNGP04.phx.gbl... > > > What is wrong with storing the images in the database? I have written > > similar systems without any performance problems. > > > > > > Bryan Phillips > > MCSD, MCDBA, MCSE > > Blog: http://bphillips76.spaces.live.com > > > > > > > > > > "Brent" <brentwa@spam.hotmail.com> wrote in message > > news:17181D47-F90B-4C2D-8D84-D190139F3302@microsoft.com: > > > > >> Hi eveyrone. I am writing a client/server application that has to deal > >> with > >> displaying images to the user. The user will have the ability to add > >> images > >> to entries. Ok im kind of looking for a best practice here on what to do > >> with the images. I am using SQL Server 2005 and i know that i do not want > >> to > >> store the images in blog fields in sql server. That is a definite. What > >> other choices do i have here? Maybe you can binary serialize the image > >> and > >> use either remoting or web services to send the image over the wire and > >> store it in a directory. The directory location would be located in sql > >> server. This seems like a plausable solution but seems quite messy. What > >> other solutions are there? What solution do you think is the best? If i > >> end > >> up doing the solution i came up with then i would have to include that > >> part > >> in the database transaction and it could be asynchronous because if the > >> saving of the image fails i also want to fail the transaction. Just > >> looking > >> for some ideas here guys. I didn't know what other newsgroup would be > >> fitting since this is a general question. > >> > >> Thanks, > >> Brent > > > |
|||||||||||||||||||||||