Images in database vs file system

前端 未结 10 839
甜味超标
甜味超标 2020-11-29 23:23

We have a project coming up where we will be building a whole backend CMS system that will power our entire extranet and intranet with one package. The question I have been

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 23:31

    Generally, persisting image data in the DB might not be as efficient as the FileSystem, as far as a CMS is concerned. At one time you probably just want to display the image statically, at other times you want that image to be available to your graphic designers for updates etc.

    Consider the processing overhead associated with retrieving the image each time you want to work with it.

    A few points why you should consider the FileSystem

    1. The browser does all the work, and the you benefit from proxy caching of images etc
    2. As an offshoot of the above, you get to easily use Content Delivery Networks (CDN)
    3. Replication of image data is easy with tools like rsync etc
    4. Processing (i.e. CPU) time is drastically optimized

提交回复
热议问题