After reading Storing Images in DB – Yea or Nay? I think that the file system is the right place for storing images. But I would like to know how you handle backup/version control of uploaded images in your different environments (dev/stage/prod) and for network load balancing?
These problems is pretty easy to handle when working with a database e.g. to make a backup from the production environment and restore the DB in the development environment.
What do you think of using for example git to handle version control of uploaded files e.g?
- A image is uploaded to a shared folder at the web server.
- Meta data is stored in the database
- The image is automatically added to a git repository
Developer at work:
- Checks out the source code.
- Runs a script to restore the database.
- Runs a script to get the the latest images.
I think the solution above is pretty smooth for the developer, the images will be under version control and the environments can be isolated from each other.