Storing Large Number Of Files in File-System

后端 未结 4 507
独厮守ぢ
独厮守ぢ 2021-02-06 03:24

I have millions of audio files, generated based on GUId (http://en.wikipedia.org/wiki/Globally_Unique_Identifier). How can I store these files in the file-syste

4条回答
  •  一个人的身影
    2021-02-06 03:56

    That's very easy - build a folder tree based on GUID values parts.

    For example, make 256 folders each named after the first byte and only store there files that have a GUID starting with this byte. If that's still too many files in one folder - do the same in each folder for the second byte of the GUID. Add more levels if needed. Search for a file will be very fast.

    By selecting the number of bytes you use for each level you can effectively choose the tree structure for your scenario.

提交回复
热议问题