I'm thinking about developing my own PHP based gallery for storing lots of pictures, maybe in the tens of thousands.
At the database I'll point to the url of the image, but here's the problem: I know is impractical to have all of them sitting at the same directory in the server as it would slow access to a crawl, so, how would you store all of them? Some kind of tree based on the name of the jpeg/png?
What rules to partition the images would you recommend me?
(It will focused for using in cheapo dot coms, so no mangling with the server is possible)
The large images should be stored in something like AWS S3, HDFS, a Content Delivery Network (CDN), a web server, file server or whatever else would be great a serving up large static objects, in accordance with your use case and budget.
We had a similar problem in the past. And found a nice solution:
We have experienced that using the guids, you get a more or less uniform division. And it worked like a charm.
Links which might help to generate a unique ID:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With