Cassandra Connector > Introduction to Cassandra Connector > Introduction to Cassandra
  

Introduction to Cassandra

Cassandra is an open source, NoSQL database that is highly scalable and provides high availability. You can use Cassandra to store large amounts of data spread across data centers or when your applications require high write access speed.
In a Cassandra database, a column family is similar to a table in a relational database and consists of columns and rows. Similar to the relational database, each row is uniquely identified by a row key. The column name uniquely identifies each column in the column family. The number of columns in each row can vary, and client applications can determine the number of columns in each row.
You can read, write, and manipulate a group of data by using collections in Cassandra. The Cassandra database supports the following collection types:
To effectively query data, you can use the dynamic column family feature in Cassandra. For example, the following CQL definition creates a column family that can store information about users and their friend lists.
CREATE TABLE users_list(
username text PRIMARY KEY,
friendlist list<text>);
Each row in the users_list column family contains a user name and the corresponding list of friends for each user. The friendlist column is a collection of list type. The rows in the users_list column family can contain different number of friendlist columns, and each row effectively represents a snapshot of a query on a user's friend list.
The following CQL insert statement inserts a row that contains a user name and the corresponding friend list:
insert into users_list (username, friendlist) values(user1,{‘ userxyz’, ‘userabc’,’ userqwe’});