can we store binary data to apache cassandra?
i'm thinking about storing image to apache cassandra
it depends on the size, cassandra is not suitable for large binary objects, it can store up to 2gb by each column splitted into 1 mb. you can store the files in filesystem (or a cdn for web) and store the links and maybe with previews to cassandra, or you can take a look at mongodb+gridfs.
Cassandra blob data type represents a constant hexadecimal number. The Cassandra blob data type represents a constant hexadecimal number defined as 0[xX](hex)+ where hex is a hexadecimal character, such as [0-9a-fA-F]. For example, 0xcafe. The maximum theoretical size for a blob is 2 GB.
Cassandra can store data in sets of key-value pairs using the Map data type. It allows you to store data and assign labels (key names) to it for easier sorting. Sets. You can store multiple unique values, using the Set data type.
In Cassandra, Blob data type represents constant hexadecimal data type and the number is defined as 0[xX](hex)+ where hex means hexadecimal. It is useful to store a short string or small images. Let's understand with an example. To create table function_test1 used the following CQL query.
"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. "
From: CassandraLimitations
it depends on the size, cassandra is not suitable for large binary objects, it can store up to 2gb by each column splitted into 1 mb. you can store the files in filesystem (or a cdn for web) and store the links and maybe with previews to cassandra, or you can take a look at mongodb+gridfs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With