DataStax: Introduction to NoSQL Databases Workshop

Shubham Chandra
2 min readAug 5, 2021

What is NoSQL Database?

NoSQL databases are designed to support cloud application requirements and overcome the scale, performance, data model and data distribution limitations of traditional relational databases (RDBMS’s).

Introduction to NoSQL Database

What is Apache Cassandra?

Apache Cassandra is an Open source NoSQL distributed database trusted by thousands of companies for scalability and high availability without compromising performance.Linear scalability and proven fault-tolerence on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data. (Read more).

ASTRA DB is the simplest way to run Cassandra with zero operations at all - just push the button and get your cluster.

ASTRA DB runs on CQL (Cassandra Query Language)

  • Click Here to Register into Astra DB
  • Choose “Start Free Now”
  • Choose the “Start Free Now” plan, then “Get Started” to work in the free tier.
  • You will have plenty of free initial credit (renewed each month!), roughly corresponding to 40 GB of storage, 30M reads and 5M writes.

To create the database:

  • For the database name — nosql_db. While Astra DB allows you to fill in these fields with values of your own choosing with database name.
  • For the keyspace name — nosql1. It's really important that you use the name "nosql1" for the code to work.
  • For provider and region: Choose and provider (either GCP or AWS). Region is where your database will reside physically (choose one close to you or your users).
  • Create the database. Review all the fields to make sure they are as shown, and click the Create Database button.

Tabular databases:

Tabular databases organize data in rows and columns, but with a twist from the traditional RDBMS. Also known as wide-column stores or partitioned row stores, they provide the option to organize related rows in partitions that are stored together on the same replicas to allow fast queries.

Describe your Keyspace

  • Select your db
  • Select CqlConsole
  • Enter the command — describe keyspaces;

Create tables:

  • use your database name (ex- use nosql1)
  • create table query
CREATE TABLE IF NOT EXISTS videos (
videoid uuid,
email text,
title text,
upload timestamp,
url text,
tags set <text>,
frames list<int>,
PRIMARY KEY (videoid)
);
  • Visualize structure
describe keyspace nosql1;
  • Insert some entries on first table
INSERT INTO videos(videoid, email, title, upload, url, tags, frames)
VALUES(uuid(),
'clu@sample.com',
'Introduction to Nosql Databases',
toTimeStamp(now()),
'https://www.youtube.com/watch?v=cMDHxsGbmC8',
{ 'nosql','workshop','2021'},
[ 1, 2, 3, 4]);
  • Read values
select * from videos;

To Learn more about Cassandra Query Language::

Introduction to NoSQL (Cassandra Query Language)

Video Workshop Link: https://www.youtube.com/watch?v=xV0hshyvYEE

Thank You!

--

--

Shubham Chandra
0 Followers

Open Source enthusiastic , 3rd Year Student from Birla Institute Of Technology,Mesra