Cassandra 适合存储文件吗?

发布于 2024-12-26 06:14:46 字数 163 浏览 5 评论 0原文

我正在开发一个 php 平台,该平台将大量使用图像、文档和我想到的任何文件格式,所以我想知道 Cassandra 是否是满足我需求的不错选择。

如果没有,你能告诉我应该如何存储文件吗?我想继续使用 cassandra,因为它具有容错能力并且在节点之间使用自动复制。

感谢您的帮助。

I'm developing a php platform that will make huge use of images, documents and any file format that will come in my mind so i was wondering if Cassandra is a good choice for my needs.

If not, can you tell me how should i store files? I'd like to keep using cassandra because it's fault-tolerant and uses auto-replication among nodes.

Thanks for help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

街角迷惘 2025-01-02 06:14:46

来自cassandra wiki

Cassandra's public API is based on Thrift, which offers no streaming abilities 
any value written or fetched has to fit in memory. This is inherent to Thrift's 
design and is therefore unlikely to change. So adding large object support to
Cassandra would need a special API that manually split the large objects up 
into pieces. A potential approach is described in http://issues.apache.org/jira/browse/CASSANDRA-265.    
As a workaround in the meantime, you can manually split files into chunks of whatever 
size you are comfortable with -- at least one person is using 64MB -- and making a file correspond 
to a row, with the chunks as column values.

所以如果您的文件< 10MB 应该没问题,只要确保限制文件大小,或将大文件分成块即可。

From the cassandra wiki,

Cassandra's public API is based on Thrift, which offers no streaming abilities 
any value written or fetched has to fit in memory. This is inherent to Thrift's 
design and is therefore unlikely to change. So adding large object support to
Cassandra would need a special API that manually split the large objects up 
into pieces. A potential approach is described in http://issues.apache.org/jira/browse/CASSANDRA-265.    
As a workaround in the meantime, you can manually split files into chunks of whatever 
size you are comfortable with -- at least one person is using 64MB -- and making a file correspond 
to a row, with the chunks as column values.

So if your files are < 10MB you should be fine, just make sure to limit the file size, or break large files up into chunks.

好倦 2025-01-02 06:14:46

10MB 的文件应该没问题。事实上,如果我没记错的话,DataStax Brisk 在 Cassandra 之上放置了一个文件系统:http://www.datastax.com datastax.com/products/enterprise

(我与他们没有任何关系 - 这不是广告)

You should be OK with files of 10MB. In fact, DataStax Brisk puts a filesystem on top of Cassandra if I'm not mistaken: http://www.datastax.com/products/enterprise.

(I'm not associated with them in any way- this isn't an ad)

晌融 2025-01-02 06:14:46

作为最新消息,Netflix 为其 cassandra 客户端提供了名为 astyanax 的实用程序,用于将文件存储为已处理的对象存储。说明和示例可以在此处找到。使用 astyanax 编写一些测试并评估 Cassandra 作为文件存储可能是一个很好的起点。

As fresh information, Netflix provides utilities for their cassandra client called astyanax for storing files as handled object stores. Description and examples can be found here. It can be a good starting point to write some tests using astyanax and evaluate Cassandra as a file storage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文