MySQL BLOB vs File for Storing Small PNG Images?

前端 未结 2 1888
谎友^
谎友^ 2020-12-21 18:17

Is it better practice to store a lot of small PNG images (<5KB mostly) in my database as BLOBs or would it be better to store them as image files in a directory?

2条回答
  •  孤城傲影
    2020-12-21 18:37

    From a performance standpoint, serving from local static files will always be faster. Don't go to the database unless you absolutely need to, there's a lot of overhead for making connections and queries.

提交回复
热议问题