2012-01-12 135 views
18

我开发一个PHP平台,这将使庞大的使用图片,文档和会在我的脑海里,所以我在想,如果Cassandra是我需要一个不错的选择的任何文件格式。Cassandra是否适合存储文件?

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

感谢您的帮助。

+0

有多大的文件? – 2012-01-12 22:04:50

+0

不要以为文件大于10 MB – siannone 2012-01-12 22:06:57

回答

11

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 <你应该罚款,只要确保限制文件大小,或将大文件分成大块。

5

你应该与10MB的文件确定。事实上,DataStax轻灵穿上卡桑德拉之上的文件系统,如果我没有记错的话:http://www.datastax.com/products/enterprise

(我没有任何与之相关联way-这不是一个广告)

3

新鲜的信息,Netflix公司提供用于存储文件作为处理对象存储了一个名为astyanax他们卡桑德拉客户端实用程序。说明和示例可以在here找到。使用astyanax编写一些测试并评估Cassandra作为文件存储可能是一个很好的起点。