Scenario

Customers can publish a product and can include as much as 5 images using the publish, each image that's submitted must be resampled and resized - an overall total of four extra images are produced. Meaning when the user uploads 5 images finish track of 25 images total to keep.

Presumptions

  • The pictures happen to be correctly checked and they are valid image files
  • The machine needs to scale (let us assume 1000 posts first and foremost, so maximum 5000 images)
  • Each image is re-named with regards to the car_incremenet id from the db publish entry and includes relevant suffix i.e. 12345_1_1.digital 12345_2_1.digital - so there is no difficulties with replicates
  • The pictures aren't of the sensitive character, so there is no difficulties with getting them directly accessible (although directory listing could be disabled)

Possible approaches

  • Because of the ids are unique we're able to just drop them into one folder (ineffecient following a certain point).
  • Could produce a folder for every publish and put all of the images into that, so ROOT/images/12345 (again, would finish track of numerous folders)
  • Could do a picture store according to date, i.e. every day a brand new folder is produced and also the days images are saved inside.
  • Could keep images in line with the resized type, i.e. all of the original files might be saved in a single folder images/orig all of the pictures in images/thumb (i believe Gumtree uses a strategy such as this).
  • Could allow X quantity of files to become saved in a single folder before creating a different one.

Anybody have experience around the guidelines / approaches if this involves storing images scalably?

Note: I prememt someone will mention S3 - let us assume you want to keep your images in your area for the moment.

Thank you for searching