SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Best way to store photos


Best way to store photos

Author
Message
dubem1-878067
dubem1-878067
Valued Member
Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)

Group: General Forum Members
Points: 68 Visits: 158
Hello

our app is used for plant inspection. Each inspection file will have about 30 photos. We resize photos so each weights about 60 k
We evaluate 25 000 inspection file per year.
So 45 gigs of photos in the database after one year and 90 gigs after two years
How to manage this efficiently in SQL Server? (performance...backup..etc)

thanks

Martin
Sean Lange
Sean Lange
SSC-Dedicated
SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)

Group: General Forum Members
Points: 33989 Visits: 17681
There are basically 3 ways to handle storing binaries with sql.

1) Store the files on disc in a folder and then store the file name in sql. You basically just use sql as a way to track which file belongs to a given row in the table.

2) Store the actual file in a varbinary(max) column. This can be a bit unwieldy as you get large numbers of files due to page and index fragmentation. You also have to be careful not to select that column with every day queries. I have done this in the past by having a table that holds nothing but the image, an identity and a foreign key.

3) Filestream. Not sure this is what you want given the small size of the files you are working with. You read more about this option here. http://msdn.microsoft.com/en-us/library/bb933993%28v=sql.105%29.aspx

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
DiverKas
DiverKas
Old Hand
Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)Old Hand (373 reputation)

Group: General Forum Members
Points: 373 Visits: 460
I would recommend the file system and store the path in the SQL Server. Ultimate flexibility and easiest to code.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search