performance - Directory structure for storing images ASP.NET - Advice needed -
i'm working on application store around 50.000 images within it's first year , 75.000 in it's second. images can come galleries, news images, article images , profile images. want give each image guid , store guid in database.
as directory structure thinking of this:
~/upload/images/f2/50/f2504e0-4f89-11d3-9a0c-0305e82c3301.jpg
so i'm using first 4 characters of guid directory structure spread images bit more evenly between directories.
now have questions approach:
- is considered practice store different kinds of images rather use
~/images/upload/profiles
,~/images/upload/articles
etc. - i'm storing thumbnails , have different guid thumbs not in same folder original , somehow doesnt give me feeling guess should not matter but.
- same goes galleries, i'm used store galleries in folders
~/images/upload/galleries/12
, , images gallery scattered around in different subfolders, big performance hit? - do guys have other ideas directory structures?
as can see i'm bit afraid use approach since there lots of images maybe more numbers gave have let control go think :)
please give me opinions on thank much.
kind regards, mark
edit:
forgot mention, images deleted also
my comment suggest not directories plan to; instead, see if can put sort of logical organization folder structure. i'd willing bet might end pulling hair or 2 out that, random, directory structure.
keep in mind possibility of exposing private information, though; shouldn't have directory structure reveals user names if not public, example.
one possibility; have them based on time... ~/images/upload/2010/11/15
example. go further if seems good, or not far if prefer. (only go month, example; or week number instead of day). i'd recommend keeping leading 0's such scheme, ease of sorting.
then again; depending on how using them, such structure might not good, either. thought popped head :)
Comments
Post a Comment