This is more of a algorithm question, but I am trying to figure out what would be the most efficient for a large database of pictures. Would it make more sense to store a lot of files all under one directory (ex:pictures/userid_pic_profile.png) or multiple directories for a few number of files (ex: userid/profile.png userid/avatar.png)?
Share
For organizational reasons alone you should be using multiple directories.
Additionally, for some operating systems having a very large number of files in one directory can cause real slowdowns when listing and searching for files (I am talking about thousands and tens of thousands of files in a single directory).