I understand this theme continues to be broadly talked about previously, and that i completely analysed the numerous informative solutions around the matter - verifying my concept that, generally, storing blobs within the db isn't good practice.
Now let us have a look in the following situations:
users, with a one-to-many relationship with
imagesrows would contain, aside from
users' FK plus some metadata (date, title...), the next binaries (or file pathways pointing towards the following binaries):
- Thumbnail (a absurdly small binary)
- Fullsize (will really be preprocessed, to become about 400x600 and around 35-45kb
- I'll will never need data in the
imagestable with no image too (and anyway, I understand where to not use
- I wish to use fs and memory cache
- In most scenario, I'll only need the thumbs (only obtaining the fullsize images dynamically on some occasions and, in individuals cases, providing them with by ID). Making clear: either many super small pictures a treadmill still pretty small one per call
- Customers may wish to change their pictures' data, remove them, change them a great deal.
Everything appears to create me believe that the DB option would be optimal.
Exist disadvantages I miss out on (aside from the apparent open db connection in case of no cache)?
One condition in this is making backup copies, or syncing a "development" or "test" atmosphere using the production one (getting around a db dump could be painful). It is also a lot more better to edit en masse all of the images, if they're on fs (say: mass produce a new size for that images).
Anyway, I do not fully enter into the actual benefits of this method versus a "pointers in db, files on fs" one. The memory cache, possibly? Nowadays after i consider blobs, I think about S3 anyway :)