gpt4 book ai didi

nosql - Cassandra是否适合存储文件?

转载 作者:行者123 更新时间:2023-12-03 12:45:39 24 4
gpt4 key购买 nike

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

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

感谢帮助。

最佳答案

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.

因此,如果文件大小小于10 MB,就可以了,只需确保限制文件大小,或将大文件分成几块即可。

关于nosql - Cassandra是否适合存储文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8842837/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com