我正在开发一个php平台,将大量使用图像、文档和任何我能想到的文件格式,所以我想知道Cassandra是否是满足我的需求的一个好选择。
如果不是,你能告诉我应该如何存储文件吗?我希望继续使用Cassandra,因为它具有容错性并且在节点之间使用自动复制。
感谢您的帮助。
我正在开发一个php平台,将大量使用图像、文档和任何我能想到的文件格式,所以我想知道Cassandra是否是满足我的需求的一个好选择。
如果不是,你能告诉我应该如何存储文件吗?我希望继续使用Cassandra,因为它具有容错性并且在节点之间使用自动复制。
感谢您的帮助。
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,那么应该没有问题,只需确保限制文件大小,或将大文件分成几个部分。