Tips for managing a large number of files?

后端 未结 6 1852
走了就别回头了
走了就别回头了 2020-12-13 21:45

There are some very good questions here on SO about file management and storing within a large project.

Storing Images in DB - Yea or Nay?
Would

6条回答
  •  鱼传尺愫
    2020-12-13 22:23

    One way is to assign a unique number to each file and use it to look up the actual file location. Then you an use that number to distribute files in different directories in the filesystem. For example you could use something like this scheme:

    /images/{0}/{1}/{2}

    {0}: file_number % 100
    {1}: (file_number / 100) % 100
    {2}: file_number

提交回复
热议问题