0% found this document useful (0 votes)
5 views9 pages

Cassandra Data Base1

Cassandra is an open-source NoSQL database developed by Facebook and released by Apache, designed for high scalability and fault tolerance. It features a decentralized architecture, supports various data types, and utilizes a unique data model inspired by Google's BigTable. Key operations include managing keyspaces, tables, and data replication strategies to ensure high availability and performance.

Uploaded by

bgsitanishta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

Cassandra Data Base1

Cassandra is an open-source NoSQL database developed by Facebook and released by Apache, designed for high scalability and fault tolerance. It features a decentralized architecture, supports various data types, and utilizes a unique data model inspired by Google's BigTable. Key operations include managing keyspaces, tables, and data replication strategies to ensure high availability and performance.

Uploaded by

bgsitanishta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

CASSANDRA DATA

BASE
SUBMITTED BY,
HITHASHREE N R
HITHASHREE H P
HARSHAVARDHAN A C
INTRODUCTION:
• Developed by: Facebook; Released by Apache
• Named after: Trojan prophet Cassandra
• Written in: Java
• Design Based On: Amazon's Dynamo

Key Characteristics:
• Open-source & NoSQL
• Highly Scalable & Distributed
• Column-Oriented, Fault Tolerant
• Decentralized with Tunable Consistency
• Schema-free (semi-structured, unstructured support)
FEATURES AND DATA REPLICATION
Core Features:
1. High write throughput (low-cost writes).
2. Data duplication for reliability.
3. No support for Joins, Group By, Aggregations.
4. Uses ordered keys and semi-structured data.
5. Fast, scalable, and decentralized – no master node.
6. Handles large volumes of structured/unstructured data.
Data Replication:
• Stores data across multiple nodes.
• No single point of failure.
• Ensures high availability (CAP Theorem).
• Uses replication strategy & factor.
• Supports read repair for stale data.
Apache Cassandra – Components &
Strategies
Components of Cassandra:
• Node: Stores and processes data.
• Data Center: Group of related nodes.
• Cluster: Collection of data centers.
• Commit Log: For crash recovery; logs every write.
• Mem-table: In-memory store; temporary write space.
• SSTable: Data flushed from mem-table to disk when threshold is reached.
• Bloom Filter: Efficiently checks data existence after each query.
Scalability:
• Linear scalability increases throughput and reduces response time as nodes
increase.
Transaction Support:
• Supports ACID properties (Atomicity, Consistency, Isolation, Durability).
Replication Strategies:
• Simple Strategy: Sets a replication factor for the cluster.
• Network Topology Strategy: Sets different replication factors per data
Cassandra – Data Types & Data
Model
CQL Data Types:
•Basic Types: ascii, bigint, blob, boolean, counter, int, float, double,
timestamp
•Textual Types: text, varchar
•Complex Types: list, map, set
•Network Type: inet
•Others: varint (arbitrary precision integer)

Cassandra Data Model:


•Inspired by Google’s BigTable.
•Uses row key + column key + timestamp.
•Data split into tablets (max 200 MB).
•Tablets stored using METAO for metadata indexing.
•Caching improves performance by reducing query load.
Cassandra CQL - Describe &
Consistency Commands
DESCRIBE Commands:
Used to print schema or cluster details:
•DESCRIBE CLUSTER, DESCRIBE SCHEMA, DESCRIBE KEYSPACES
•DESCRIBE KEYSPACE <name>, DESCRIBE TABLES, DESCRIBE TABLE
<name>
•DESCRIBE INDEX, VIEW, TYPES, FUNCTIONS, AGGREGATES
Consistency Command:
•CONSISTENCY - Shows/set consistency level
Levels:
•ALL: Write to all replicas
•EACH_QUORUM: All replicas in all DCs
•LOCAL_QUORUM: Quorum in local DC
•ONE, TWO, THREE: Writes to 1/2/3 nodes
•ANY: At least 1 node
•SERIAL, LOCAL_SERIAL: For linearizable consistency
KEYSPACES
 A keyspace (or key space) in a NoSQL data store is an object that
contains all column families of a design as a bundle. Keyspace is the
outermostgrouping of the data in the data store. It is similar to relational
database. Generally, there is one keyspace per application. Keyspace in
Cassandra is a namespace that defines data replication on nodes. A
cluster contains one keyspace per node. Create Keyspace Command
CREATE KEYSPACE WITH replication = {'class': '', 'replication_factor':
''}AND durable_writes= ''; CREATE KEYSPACE statement has attributes
replication with option class and replication factor, and durable_write.
Default value of durable_ writes properties of a table is set to true. That
commands the Cassandra to use Commit Log for updates on the current
Keyspace true or false. The option is not compulsory. 1. ALTER KEYSPACE
command changes (alter) properties, such as the numberof replicas and
the durable_writes of a keyspace: ALTER KEYSPACE WITH replication =
{'class': '', 'replication_factor': ''}; 2. DESCRIBE KEYSPACE command
displays the existing keyspaces. 3. DROP KEYSPACE command drops a
keyspace: 4. Re-executing the drop command to drop the same
keyspace will result in configuration exception. 5. Use KEYSPACE
command connects the client session with a keyspace.
Key CQL Commands
Command Functionality
Creates a new keyspace (like a
CREATE KEYSPACE
database)
USE Sets the current keyspace
Creates a new table in the
CREATE TABLE
keyspace
ALTER TABLE Modifies an existing table
DROP TABLE Deletes a table
INSERT INTO Inserts new data into a table
SELECT Retrieves data from a table
UPDATE Updates existing data
DELETE Deletes data from a table
TRUNCATE Deletes all rows from a table
Deletes a keyspace and all its
DROP KEYSPACE
tables

You might also like