do you think that if i will have 1 millions directories in a directory will make that directory very hardly accessible?! Like if i will query a file like db/name/file.txt it wil take lot of time to open that file?! or i should create subdirectories like db/n/a/m/e/file.txt ?!
You should be fine. Either structure will work - your bigger problem will be how you manage the content. Should some of this be in a database, perhaps?
sarahk got it perfect... also it will be extremely hard to manage all the content that is inside there. Why use databases? maybe use mod_rewrite to create virtual driectorys? and keep everything in one folder? Would make more sense to me mckST
If you plan to access these folders via your FTP client, you or your server may get problems, because the FTP client would have to download the directory list, which also includes writing/access permissions and last modification dates. Now if the server has to check a few millions of folders for all these details, and the FTP has to download this huge list, you could get in trouble. On both sides. Follow the suggestions above, if possible. And use a database or mod_rewrite. Or structure your folders in a way that they are not all (few millions) in the same directory.
I wouldn't put a million directories in a subdirectory, for the reasons above. If you *must* have all them in flat files, use your "db/n/a/m/e/file.txt" structure.
yes but 1 questin ... if i will have 1 millions directories in a sub directory, won't this make them hard to be accessed? windows and linux store all directories/files into a VFAT. I known they use some graph tehniques... The whole directory structures of your hard disk it's an genetic tree. So won't this create any problem? like if 1 millions subdirectories,won't take a lot of time to process the names,etc... if you do a cd ...
Potentially... but compared to the management issues it'll be nothing. Consider the points above especially * ftp access * managing the local copy on your windows pc * alternatives using database and mod_rewrite * security flaws when you set something wrong... perhaps you need to spell out the business problem you are trying to solve so we can understand better.