Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 opinion this is a very wrong solution ? Should I rebuild all the site ?

There are about 1000 visits per day and about 600 images in the database.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
298 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...