Skip to content

Cassandra Store

goir edited this page Feb 21, 2012 · 1 revision

Cassandra Store

The Cassandra Store can store any kind of data including increasing/decreasing of counter Columns. Each Message must be a JSON String like the examples below.
To save bandwith you can compress the Message with gz. The Store automagically detects whether a message is compressed or not.

Columns or Super Columns

To Store any kind of data you must use a Format like this

{
	"rowKey": "rowKey",
	"scName": "scKey",
	"data": {
		"column1": "column value 1",
		"column2": 10,
                ...
	}
}

scName is just required if you write into a Super Column Family.

Counter Columns

If you want to increase/decrease a counter column you need to specify the extra counter flag like so:

{
	"rowKey": "rowKey",
	"scName": "scKey",
        "counter": true,
	"data": {
		"column1": 1,
		"column2": -10,
                ...
	}
}
Clone this wiki locally