I am implementing a project that deals with a significant amount of images.
In your opinion what are the cons/pros of the following two approaches:
- I need to store thousands of items, each item as several string properties and an image.
- Each item as an ID (integer)
- MyISAM tables
- How would you store the images:
- approach 1: store images into a directory and each image named as ID.jpg
- approach 2: store images into the database as a binary BLOB
Using approach 1 I can access the image directly and that's it
<img src="same_directory/10.jpg" />
Using approach 2, I can still use the above HTML, but need to redirect that jpg access to a PHP script which will return the real image from the DB.
In terms of performance which one do you think its faster?
I am keen to approach 1.