Featured post
php - Retrieving images - MySQL based or file system based, which one is faster? -
i'd know if it's faster/better retrieve image(s) particular product or blog post or whatever in website getting path/filename database along rest of data, or if should create folder product id , use glob iterate on or use id filename in case of single image, example.
what advantages/disadvantages these approaches?
it's faster use paths/name methods (- 1 database calls; composing string not time/memory consuming operation). way, in case you'll have different images same product id, might create foreach loop looks in given folder pic1.png, pic2.png [...] picn.png.
there problem, though: changing images become more convoluted process - instead of uploading new ones , updating db, have delete previous (or previous set) relative thumbnails if before uploading new ones; mean image change process won't reversible unless store old ones in backup directory, etc.
so, (you plan change them || users change them often) ? database : paths
- Get link
- X
- Other Apps
Comments
Post a Comment