Special Offer - Enroll Now and Get 2 Course at ₹25000/- Only Explore Now!

All Courses
Cassandra Tutorial

Cassandra Tutorial

May 31st, 2019

Cassandra Tutorial

Cassandra Tutorial: A Boon To Software Professionals In Terms Of Managing Large Scale Structured Data.
Cassandra or Apache Cassandra is basically a database for scalability and high availability of data with an unwavering execution. It is the best dashboard for linear scalability and manifested fault prevention on commodity hardware or cloud infrastructure.

What is Cassandra?

Cassandra is a compartmentalized database from Apache which is highly scalable and aimed at managing a good deal of structured data. High availability with no iota of failure is fully ensured. It is a type of NoSQL database. Cassandra tutorial pdf can provide structured details.

Proviso

Cassandra, in this context, is an introductory tutorial and can be easily understood with the help of basic knowledge of Java programming. Nonetheless, prior knowledge of database and Linux flavours will be an added benefit.

NoSQLDatabase

It is a database that gives you the way to mechanism to retrieve data from store other than the tabular relations utilized in relational databases. Databases have some unique factors such as they are prone to easy reproduction, schema-free, in unison with uncomplicated API, ultimately reconcilable and capable of handling considerable data. The basis of a NoSQL database is:

  • Design clarity
  • Horizontal scaling
  • Impressive dominance over availability

Apache Cassandra

It is virtually a storage system (database) which is open sourced, decentralized and distributed. It ably controls a great deal of structured data that extended across the globe. It is not susceptible to any failure as such and always available. Principal features are as follows:

  • Column-oriented database.
  • Designed in accordance with Amazon’s Dynamo and the data model extracted from Google’s Bigtable.
  • Being created in Facebook, it is contrary to relational database management systems.
  • It is referred to by some of the most reputed social media tycoons like Cisco, Facebook, Twitter, Rackspace, Netflix, eBay etc.

Characteristics of Cassandra

Flexible scalability:

It can accommodate more hardware and in turn, attract huge customers and subsequently more data as per requirement.

Always available:

In Cassandra, failures are minuscule and are consistently stands by business-critical applications.
It follows a linear matrix i.e., more the through put more will be the number of nodes in the cluster. Thus, it saves time.

Elasticity in data storage:

Cassandra endorses all available data formats viz., semi-structured, structured and unstructured. It can change itself remarkably as per need.

Simple data distribution:

It replicates data across multiple data centers with flexibility.

Transaction support:

It makes itself compatible with the elements like Atomicity, Isolation, Consistency and Durability (ACID).

Rapid writing:

It can adjust to work on cheap commodity hardware and can write on a brisk pace, accommodating considerable data without sacrificing the reading efficiency.

Looking Back:

It was an in house development by Facebook, aiming at inbox searches.

Purpose of Cassandra

  • A cluster contains multiple nodes with equal status. Each node is independent simultaneously interrelated to other nodes.
  • Irrespective of the location of the data in a cluster, each and every node is conducive to read and write requests.
  • Read and write requests can be also be aided by other nodes in the network when a particular node goes down.

Data Replication in Cassandra

For a defined piece of data in Cassandra, multiple nodes in a cluster act as replicas. Nodes are identified with outdated values and most recent value is returned to the client. Post this returning activity, Cassandra performs a read repair in the background in order to update the stale values.

Note:

Cassandra runs the Gossip Protocol in the background to enable the nodes to interact with each other and assess the existence of any defective node in the cluster.

SSTable:

When contents of the mem table are full to the brim, the excess data is transferred to the SSTable.

Bloom Filter:

The mechanism is executed through fast, non-deterministic algorithms.

Cassandra Query Language (CQL)

The access to Cassandra can be made through its nodes with the help of CQL. CQL views database (Keyspace) as a container of tables. The respective programmers use cqlsh prompt to link with CQL or other application language drivers.

Storage of data

Cluster:

Cassandra database is compartmentalized within several machines in cohesion. The outermost container is called Cluster. Cassandra sets up the nodes in a ring format (Cluster) and subsequently, data is assigned to them.

Keyspace:

It is the outermost container in Cassandra so far as data is concerned. The basic features are as follows:

Replication Factor

The cluster does have a number of machines that receive copies of the identical data.

Replica placement strategy

The strategy to place replicas in the ring is termed as RPS. These chiefly constitute a simple strategy, old network topology strategy and network topology strategy.

Column families:

A column family, in turn, denotes a container of a collection of rows. Column families represent the structure of the data. Each keyspace does possess a minimum one or multiple column families.

Column family:

It is a container for an orderly row. Each row, in turn, is an ordered collection of columns.

Cassandra Installation

Cassandra can be installed using cqlsh as well as drivers (Java environments) of different languages.

Deduction

By now, you might have caught a glimpse of the basic introduction of Cassandra, Cassandra architecture, installation (in a nutshell), important classes and interfaces. The above Cassandra documentation may prompt you to choose it as the best Cassandra tutorial.