Cassandra Tutorial | Data types | Why Cassandra for Big Data

vinayiqbusiness 33 views 15 slides Apr 03, 2020
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

Apache Cassandra is an open-source, NoSQL, wide column data store that can quickly take and process huge amounts of data.
It is decentralized, distributed, scalable, highly available, and fault-tolerant, , with identical nodes that are clustered together for eliminating single points of failure.


Slide Content

APACHE CAS S ANDR A

SUMMARY OF CONTENTS What is Apache Cassandra ? Evolution of Cassandra ? Why Cassandra for Big Data ? Apache Cassandra Data types ? Data Distribution in Apache Cassandra How to Add Data in Cassandra ? How to Read Data ? How to Delete Data ? Use Cases ? Advantages and Limitations

Apache Cassandra is an open-source, NoSQL, wide column data store that can quickly take and process huge amounts of data. It is decentralized, distributed, scalable, highly available, and fault-tolerant, , with identical nodes that are clustered together for eliminating single points of failure. WHA T I S APACH E CASSANDR A ?

EVOLUTIO N O F CASSANDR A ?

WH Y CASSANDR A FO R BI G DAT A ? Handles high velocity data with ease Uses schema that support broad varieties of data Is designed for continuous availability Offers quick installation and configuration for multi-node clusters. It is open source and reduces cost as compared to RDBMS.

DAT A TYPE S I N CASSANDR A ? It supports the most common data types including ASCII, Bigint , BLOB, Boolean counter, decimal, double, float, int , text, timestamp, UUID, varchar etc. Its data model offers the convenient of the column indexes with the performance of log structured updates, strong support for denormalization and materialized views and built in caching. Data access is performed using CQL (Cassandra Query Language) which is resembled to SQL (Structured Query Language).

DAT A DISTRIBUTIO N I N CASSANDR A ? Cassandra uses a peer-to-peer model for distributing the data, which enables it to fully distribute data in the form of variable-length rows, stored by partition keys. Cassandra is built for its scalability, continuous availability, and has having no single point of failure. Many Different databases, such as Postgre SQL, use a master-slave replication model, in which the writes go to a master node and reads are executed on slaves. To provide high availability, fault tolerance, and scalability, Cassandra’s peer-to-peer distribution model provides nodes with open channels of communication. Cassandra uses Tokens ( a 64 bit integer) for determining which node holds what data.

ADDIN G DAT A I N CASSANDR A ? You can insert data into the columns of a row in a table using the command INSERT. Syntax for creating data in a table is shown below. INSERT INTO <tablename> (<column1 name>, <column2 name>....) VALUES (<value1>, <value2>....) USING <option> Let us assume there is a table called std with columns (std_id, std_name, std_city, std_phone, std_fee) and you have to insert the following data into the std table.

ADDIN G DAT A I N CASSANDR A ? Use the commands given below to fill the table with required data. cqlsh: project1> INSERT INTO std (std_id, std_name, std_city, std_phone, std_fee) VALUES (1,'Ramesh', 'Hyderabad', 9191234567, 55000); cqlsh:project1> INSERT INTO std (std_id, std_name, std_city, std_phone, std_fee) VALUES (2,'Pavan', 'Visakhapatnam', 9191234567, 45000); cqlsh:project1> INSERT INTO std (std_id, std_name, std_city, std_phone, std_fee) VALUES (3,'Gayatri', 'Vizainagaram', 9191234567, 47000);

READIN G DAT A I N CASSANDR A ? SELECT clause is used to read data from a table in Cassandra. By Using this clause, you can read a whole table, a single column, or a particular cell. The syntax of SELECT clause is given below SELECT FROM <tablename> Assume there is a table in the key space named std with the following details – cqlsh:project1> select * from std; cqlsh:project1> SELECT std_name, std_fee from std;

DELETIN G DAT A I N CASSANDR A ? The following statement deletes the std_fee column of last row – cqlsh:project1> DELETE std_fee FROM std WHERE emp_id=3; Deletion of Entire row:- The following command deletes an entire row from a table. cqlsh:project1> DELETE FROM std WHERE emp_id=3; You can delete data from a table using the command DELETE. The syntax is given below DELETE FROM <identifier> WHERE <condition>;

US E CASE S FO R CASSANDR A ? Mobility Security and Fraud Detection Personalization and Recommendation IOT Cloud Operations

ADVANTAGE S? Open source Peer to peer Architecture Elastic Scalability High Availability and Fault Tolerence High performance Column oriented Tunable Consistency Schema-Free

LIMITATION S ? A single column value may not be larger than 2 Giga Bytes. The maximum number of column per row is 2 billion. All data read should fit in memory due to thrift streaming support lack. The key must be less than 64k bytes.

T H A N K Y O U