在数据库中存储非常大的文件 [英] Storing very big files in database

查看:297
本文介绍了在数据库中存储非常大的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将大文件(大约100 GB)存储在数据库中是个好主意?

目前我们考虑使用NBT格式或使用mysql / postgresql数据库将数据保存在文件夹中。

Is it a good idea to store big files (about 100 GB) in database?
Currently we think about saving data in a folder using NBT format or using mysql/postgresql database.

推荐答案

我个人的经验是,数据库不是一个大的blob的好地方(除非它们支持文件系统感知存储作为SQL Server FILESTREAM 和Oracle BFILE )。

My personal experience is that the database is not a good place for large blobs (unless they support file system aware storage, such as SQL Server FILESTREAM and Oracle BFILE).

大多数云有一个原因为blob提供单独的存储。大数据文件的生命周期不同于典型的日常数据...不同的寿命,不同的方式来提供内容,不同的缓存策略,不同的备份计划等。

There is a reason for most clouds to provide a separate storage for blobs. The life cycle of big data files is different than your typical day to day data... Different life span, different way to serve contents, different caching strategies, different backup plans, etc, etc.

查看:

  • GAE Blobstore
  • Azure Blob Storage
  • Amazon S3

我会跟着他们的领导,与文件系统感知存储系统(例如,在您的数据库中存储文件系统路径)或使用单独的存储机制。

I would follow their lead and either come up with a "File system aware" storage system (e.g., storing file system paths in your database) or use a separate storage mechanism.

每次我不得不处理在数据库中存储blob的应用程序(图片,pdf等),我花更多的时间处理表空间,备份和性能问题比我设置备份/静态文件服务/缓存策略对文件系统感知解决方案。

Every time I had to deal with applications that store blobs in the database (images, pdf and such) I've spend much more time dealing with tablespace, backups and performance problems than I did setting backup / static file serving / caching strategies on file system aware solutions.

这篇关于在数据库中存储非常大的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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