RDF and Semantic Web

Data is growing day by day exponentially and in future it will grown even with much more faster pace. To handle this huge amount of data in the current scenario using a SQL database will be cumbersome, time taking and very very difficult to manage the complex relationships. Now what is RDF. Well, it stands […]


Cassandra Hello World Example

Below article will show the example to connect to the Cassandra using Java Driver. 1) Create a Maven project in Eclipse IDE. 2) Click on Next button 3) Select Maven Archetype. For this one I have chosen maven-archetype-quickstart and click on Next button. Provide GroupID and ArtifactID and click on Finish button. 5) Add Cassandra […]

How to perform CRUD opearation on Cassandra using CQLSH

This article will show the useful commands to perform CRUD operation on Cassandra using CQLSH. 1) Insert the data Syntax is: insert into <TABLE_NAME>(COLUMN1, COLUMN2) values (VALUES1, VALUES2); The table structure to insert the data is: CREATE TABLE cassandrademo.users ( user_id int PRIMARY KEY, user_email text, user_name text, user_pwd text ) Use the following command […]

How to truncate a table in Cassandra using CQLSH

Syntax for truncating a table/columnfamily is : TRUNCATE <TABLE_NAME | COLUMN_FAMILY_NAME> Using this command will delete all the rows from the table/columnfamily. Let’s say the data in our table is: select * from users; Output: user_id | user_email | user_name | user_pwd ———+————–+———–+———- 1 | aa@gmail.com | user1 | pwd1 To truncate all the data […]

How to alter a table in Cassandra using CQLSH

Syntax for altering table/columnfamily is: ALTER TABLE <TABLENAME> <OPEARTION> or ALTER COLUMNFAMILY <TABLENAME> <OPEARTION> Below example is given for adding a column in the table. alter table cassandrademo.users add user_phone text; Verify the table structure by using: describe table users; Output: CREATE TABLE cassandrademo.users ( user_id int PRIMARY KEY, user_email text, user_name text, user_phone text, […]

How to create Columnfamilies or Tables in Cassandra using cqlsh

Syntax for creating a table/columnfamily is: CREATE TABLE <TABLE_NAME> ( ‘column-definition’, ‘column-definition’, ) (WITH <OPTION> AND <OPTION>) or CREATE COLUMNFAMILY <TABLE_NAME> ( ‘column-definition’, ‘column-definition’, ) (WITH <OPTION> AND <OPTION>) Syntax for defining a column in the table is: column_name column_data_type Example to create a table is given below: create table cassandrademo.users( user_id int Primary Key, […]

How to create Keyspace in Cassandra

In this example I am referring Cassandra 2.1.5 version Creating a keyspace Use the following to create a keyspace create keyspace cassand with replication={‘class’:’SimpleStrategy’, ‘replication_factor’:3} and durable_writes=true Here class attributes indicates the replication strategy. 3 types are strategies are applicable: Simple Strategy – Provides simple replication for the cluster. Network Topology Strategy – Each data-center […]