doudi2833 2015-02-04 23:56
浏览 33

将图像存储到特定于sql的场景

I have a very specific scenarion of storing images to mySql DB via PHP. Each image is send to server via POST request in JSON base64 encoded with other attributes and has in average 1MB. Image is written via PHP script to one dedicated table for images as string. Then it is usually read right after because of synchronization. Then it can be read several times in next 24 hours. Up to 20, average 2-3 times. Then image is not read anymore, only in special case it can be read by administrator. There are in average written 100-500 images in 24 hours range. Images older then 1 year are deleted.

In this case does it has benefit to change it and store images in file system ? a) Store it via PHP script in file system as copy of received base64 data (needs more space) b) Store it via PHP script in file system as jpg image (needs more performance)

Api via POST/JSON can not be changed I read a lot of articles about such problems, but I am asking specificaly for my scenario if it is worth to change it, and what will be gained.

  • 写回答

1条回答 默认 最新

  • duanbei3704 2015-02-05 00:30
    关注

    There are a lot things you must consider in order to know what is the best solution for you. Both approaches have their pros and cons. You gave to little information about your scenario. What's the average size os those images? What's the database size ?

    You should check this thread:

    Storing Images in DB - Yea or Nay?

    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测