Storing Images : DB or File System -

前端 未结 7 1027
既然无缘
既然无缘 2020-11-29 07:00

I read some post in this regard but I still don\'t understand what\'s the best solution in my case.

I\'m start writing a new webApp and the backend is going to provi

相关标签:
7条回答
  • 2020-11-29 07:39

    Some other reasons to store images on the file system:

    • Image servers can run even when the database is busy or down.
    • File systems are made to store files and are quite efficient at it.
    • Dumping data in your database means slower backups and other operations.
    • No server-side coded needed to serve up an image, just plain old IIS/Apache.
    • You can scale up faster with dirt-cheap web servers, or potentially to a CDN.
    • You can perform related work (generating thumbnails, etc.) without involving the database.
    • Your database server can keep more of the "real" table data in memory, which is where you get your database speed for queries. If it uses its precious memory to keep image files cached, that doesn't buy you hardly anything speed-wise versus having more of the photo index in memory.
    0 讨论(0)
提交回复
热议问题