Getting Started with Apache Cassandra

Why Apache Cassandra?

Apache Cassandra is a free, open source, distributed data storage system that differs sharply from relational database management systems.
Cassandra has become so popular because of its outstanding technical features. It is durable, seamlessly scalable, and tuneably consistent.
It performs blazingly fast writes, can store hundreds of terabytes of data, and is decentralized and symmetrical so there’s no single point of failure.
It is highly available and offers a schema-free data model.


Cassandra is available for download from the Web here. Just click the link on the home page to download the latest release version and Unzip the downloaded cassandra  to a local directory.

Starting the Server:

To start the Cassandra server on any OS, open a command prompt or terminal window, navigate to the /bin where you unpacked Cassandra,
and run the following command to start your server.
In a clean installation, you should see some log statements like this:

$ bin/cassandra -f

Congratulations! Now your Cassandra server should be up and running with a new single node cluster called Test Cluster listening on port 9160.

Running the Command-Line Client Interface:
Now that you have a Cassandra installation up and running, let’s give it a quick try to make sure everything is set up properly
The Cassandra client will start:

$ bin/cqlsh

Creating a Keyspace :

A Cassandra keyspace is sort of like a relational database.
Let’s create our own keyspace so we have something to write data to:

CREATE KEYSPACE <keyspacename> WITH replication = {'class':'<strategyname>', 'replication_factor' : <no_of_replication>};

where replication option is to specify the Replica Placement strategy and the number of replicas wanted. Strategies for replication can be one of the following:

  • Simple Strategy – Specifies a simple replication factor for the cluster.
  • NetworkTopologyStrategy – Specifies how many replicas you want in each data center.

After you have created your own keyspace, you can switch to it in the shell by typing:

$ use keyspacename;

References: Cassandra Definitive Guide


This entry was posted in Cassandra, Scala and tagged , , , , , , , . Bookmark the permalink.

4 Responses to Getting Started with Apache Cassandra

  1. shiv4nsh says:

    Reblogged this on Foobar and commented:

  2. Ankit Kumar Barthwal says:

    nice explanation of basics to start with Cassandra, thanks for sharing.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s