Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

storing binary data on cassandra just like MYSQL BLOB binary

can we store binary data to apache cassandra?

i'm thinking about storing image to apache cassandra

like image 671
zho Avatar asked Oct 12 '10 03:10

zho


People also ask

Can Cassandra store binary data?

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.

Does Cassandra support blob?

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.

Which type of data can be stored in Cassandra?

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.

What would you most likely use blobs for in Cassandra query language cql)?

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.


2 Answers

"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

like image 123
Schildmeijer Avatar answered Oct 26 '22 05:10

Schildmeijer


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.

like image 24
sirmak Avatar answered Oct 26 '22 07:10

sirmak