Is Cassandra good for storing files?
Asked Answered
C

3

22

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.

Clinkstone answered 12/1, 2012 at 21:47 Comment(1)
Don't think files will be bigger than 10 MBClinkstone
E
16

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.

Entente answered 13/1, 2012 at 6:3 Comment(1)
FWIW: Thrift API is being deprecated. But the "chunk the large files" rule seems to remain. There is an article on Walmart's use of Cassandra to store large amount of image files that speaks the same strategy: medium.com/walmartlabs/… .Timaru
F
7

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)

Fortdefrance answered 12/1, 2012 at 22:25 Comment(0)
O
6

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.

Octans answered 20/9, 2013 at 17:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.