Database Reference
In-Depth Information
Types of columns
There are a variety of columns that Cassandra supports:
Standard columns : These columns contain a name; this is either static or dynamic
and set by the writing application. A value (this is actually the attribute that stores
the data) and timestamp are shown here:
Column_name
value
timestamp
Cassandra makes use of the timestamp associated with the column to find out the
last update to the column. When data is queried from Cassandra, it orders by this
timestamp and always returns the most recent value.
Composite columns : Cassandra makes use of this storage mechanism to handle
clustered rows. This is a unique way of handling all the logical rows together that
share the same partition key into a single physical wide row. This enables Cas-
sandra to accomplish the legendary feat of storing 2 billion columns per row. For
example, let's say I want to create a table where I capture live status updates from
some social networking sites:
CREATE TABLE statusUpdates(
update_id uuid PRIMARY KEY,
username varchar,
mesage varchar
);
CREATE TABLE timeseriesTable (
user_id varchar,
udate_id uuid,
username varchar,
mesage varchar,
PRIMARY KEY user_id , update_id )
);
Search WWH ::




Custom Search