2012-01-12 46 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作爲文件存儲可能是一個很好的起點。

相關問題