Saving images in database mysql

前端 未结 5 1475
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 13:08

My client have created a script in php+mysql that saves images directly in the database and every images has url like this: www.example.com/image.php?id=421

In your

5条回答
  •  执笔经年
    2020-11-30 13:47

    Images files are files, unless there is compelling reason to store them in the database, the place they belong is the file system, where you get benefits like easy backup and replication, distributed across multiple machines, directly served by the webserver, and all the last-modified-date and etag supported by the webserver to achieve better performance, etc.

    if the number of images is expected to grow, and different sizes of one image are expected to be created (e.g. thumbnail images etc.) in the coming release, a plan to migrate images from db to file system is strongly suggested.

提交回复
热议问题