What is Cassandra



Cassandra is an open−source column−oriented NoSQL database. It is a distributed database management system that can manage large amounts of data across multiple servers. It provides high availability through data replication across multiple data−centres, which guarantees for no single point of failure. Cassandra Query Language (CQL) is its query language which is similar to SQL. To learn more about Cassandra, visit our tutorials by clicking here.

Installation Guide

Since this tutorial will be working extensively with Cassandra. Make sure it is installed on your machine, If not already installed follow our installation guide by clicking here.

Steps Post Installation

Once it is installed, we can create Keyspace. A keyspace in Cassandra is equivalent to a database in RDBMS.

Create KEYSPACE

Lets create a KESPACE named tutorials_point, using below syntax.

CREATE KEYSPACE IF NOT EXISTS tutorials_point WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};

Create table

The syntax and process of creating a table in Cassandra are also similar to the RDBMS table. a table in Cassandra can be created in a KEYSAPCE. Lets move into KEYSPACE.

use tutorials_point ;

Now, create a table customer which has two fields id, and name. Use below syntax.

CREATE TABLE customer(
   id INT PRIMARY KEY,
   name text
);
Advertisements