Showing posts with label data modelling. Show all posts
Showing posts with label data modelling. Show all posts

Monday, 20 January 2014

Cassandra Data Modelling - Primary Keys

In the previous blog we discussed how data is stored in Cassandra by creating a keyspace and a table. We also inserted rows into the table. The rows in Cassandra are stored in the form of variable key/value pairs or columns. We also observed that each row in a table is referenced by a primary key or a row key. In this post we are going to discuss more about primary keys. Primary key concept in Cassandra is different from Relational databases. Therefore it is worth spending time to understand this concept.


In our last post we created a person table which had a person_id as a primary key column.
create table person (person_id int primary key, fname text, lname text, dateofbirth timestamp, email text, phone text );
We saw that the person_id was used as a row key to refer to person data.

Thursday, 14 November 2013

Cassandra Data Modelling - Tables


In this series of posts I will discuss the basic concepts of data modelling in Apache Cassandra. It is important to understand those concepts as it will help us to design an efficient system using Cassandra. In this post I will discuss basic concept called tables in Cassandra.

I am assuming that you have installed Cassandra 1.2 or above with CQL3. You can download Cassandra from Apache Cassandra website. CQL 3.0 is the language which helps to work with Cassandra object same as SQL language helps to works with SQL objects.