c# - which one is a more scalable solution for managing image files -


i need able support user image upload , download/view images.

here options.

1) store images in sql database.

i have seen work small setup. db cost go higher size increases. backups easier. can't take advantage of caching or cdn.

2) store images in file system. have seen option being cumbersome in larger small setup. difficult manage directories huge number of files. have come hashing algorithm make sure there few images in directory , directory contains few directories. dont know if there limit in windows creating deep directory structure. use caching.

3) store images in nosql db. throwing 1 there. not familiar nosql.

4) windows azure storage/amazon storage.

couple of things. 1) money important factor. 2) windows preferred environment linux/apache solutions ok.

and 1 more thing. facebook do? or does. again.

you should go hybrid solution.

store actual binary images on filesystem, use database image metadata. gives easier medium serve files - allowing scalability , potentially speed of serving them, whilst having speed of database searching, filtering, etc.

i have seen various ways of implementing this.. primary keys + mime type + directory tied file name / folder. example, photo in /simon-whitehead/albums/stackoverflow/ directory filename 1013.jpg have it's table in database:

id - 1013 name - example.jpg albumid - (stackoverflow album id) userid - (my user id) lat - 37.81 long - 144.96 date - 7/10/2013 mime type - image/jpeg 

you may have junction table joins tags images (for searching). then, build response this:

file = getuser(userid).name / getalbum(albumid).name / getimage(imageid).name 

edit: see you've added azure. 1 company worked used azure , had fantastic experiences. didn't chance have look.. cannot give advice on that.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -