H
H
Harold2018-11-25 20:51:54
Data storage
Harold, 2018-11-25 20:51:54

What is the ideal directory structure for pictures and why?

I read articles on the Internet. But, all the same, I'm interested in answers from those who, on real projects, measured the directory structure and searched for a specific file from a large number (1k+ or 10k+ and more) of available files.
In my case, these are pictures (photos).
I read that if one folder contains all the pictures (10k files), then the search for the desired one or three pictures increases in time. And if you divide the directory into subdirectories, where there is a limit, for example, to 100 pictures, then the search is faster.
Is this true in practice?
I think that logically yes, but in reality I don’t have such a volume yet, but it is planned in the near future.
ps please correct the tags if I did not place them correctly, thanks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2018-11-25
@turbinikarpus

glob() function in PHP? - an 8-year-old test for selecting files by mask from a directory of 200,000 files.
If the file system is purple, one file per directory or 100500, this will not affect the speed of direct file access.
and then it all depends on how you are going to organize the search.

N
neatsoft, 2018-11-26
@neatsoft

Content hashes can be used as file names, files can be distributed into subdirectories whose names are formed by the first characters of file names. Example:
/34c/82a/416/34c82a416fca4cf3a1215ad5e8f2d782.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question