在DB中存储图像 - 是或否? [英] Storing Images in DB - Yea or Nay?

查看:121
本文介绍了在DB中存储图像 - 是或否?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用的应用程序在DB中存储图像。你对这方面的看法是什么?我更多的是一种类型来存储在文件系统中的位置,而不是直接存储在DB中。

So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.

你认为优点/缺点是什么?

What do you think are the pros/cons?

推荐答案

我负责管理许多TB图像的应用程序。我们发现在数据库中存储文件路径是最好的方法。

I'm in charge of some applications that manage many TB of images. We've found that storing file paths in the database to be best.

有几个问题:


  • 数据库存储通常比文件系统存储更昂贵。

  • 您可以使用标准存储例如,许多web服务器使用操作系统的 sendfile()系统调用来异步地从文件发送文件系统到网络接口。存储在数据库中的图片无法从此优化中受益。

  • database storage is usually more expensive than file system storage
  • you can super-accelerate file system access with standard off the shelf products
    • for example, many web servers use the operating system's sendfile() system call to asynchronously send a file directly from the file system to the network interface. Images stored in a database don't benefit from this optimization.

    • 管理数据库元数据和文件系统数据之间的完整性更加复杂


    这篇关于在DB中存储图像 - 是或否?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆