Question

I'm working on an application that will (hopefully) store large amount of media.

I've been looking at two possible ways to store the data in directories.

Hierarchical

 Data
├── 123
│   ├── 456
│   │   ├── 789
│   │   │   ├── track1.mp3
│   │   │   ├── track2.mp3
│   │   │   ├── track3.mp3
│   │   │   ├── track4.mp3
│   │   │   ├── track5.mp3
│   │   │   └── track6.mp3

Or storing all the files in one directory and naming each of the files after it's database id

67.mp3 68.mp3

Lets say I'll have 300,000 files. What are the pros and cons for each way of storing the data?

Was it helpful?

Solution

If you are planning on using S3, read this question at the link below and in particular my answer. I don't want to repeat it all here; better to keep the answer in one place.

Amazon AWS S3 directory structure efficiency

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top