4

I would like to know. Which one is better solution.

This is an I/O question. My web application store file in file system. But i want to know which solution should i approach. Store all files in one folder or store each file in split folder. The folder will be based on user id.

Example : User A have User ID 1 User Z have user ID 10

So in my file structure, there have 2 folder which is folder name "1" and folder name "10".And each folder have maybe like 10- 50 images file.

Im thinking about performance. Which one is more better.? Let say the user id already reach 1 million. Is there any problem to have 1 million folder in windows server.?

Any idea,?

Thanks.

shamcs
  • 629
  • 6
  • 15
  • Each user has its own folder, imagine in the future you'd add a feature that will allow the user to upload content, you wouldn't want all the users contents mixed inside a single folder, right ? –  Apr 10 '15 at 07:05
  • Yup, that is what i think, each user have one folder. But when think about performance. I really have no idea. is there any limitation. 1 million folder ++..sigh.. – shamcs Apr 10 '15 at 07:12

1 Answers1

1

Try using a database... Images can be stored in database using blob datatype

Yoganand.N
  • 907
  • 1
  • 10
  • 24
  • 1
    Database is not an option as data keep growing, and now one image can be 10 MB++. – shamcs Apr 10 '15 at 07:11
  • 1
    In that case the answer in this link might be useful for you http://stackoverflow.com/questions/197162/ntfs-performance-and-large-volumes-of-files-and-directories – Yoganand.N Apr 10 '15 at 07:16