Drop Keyspace in Cassandra

Cassandra Drop Keyspace We can drop keyspaces in Cassandra with all the data, column families, user-defined types and indexes, using the “DROP Keyspace” command. Before dropping the keyspace, a snapshot of the keyspace is taken if the keyspace exists; otherwise, an error will be returned. Syntax: DROP keyspace Keyspace_Name; Example: DROP keyspace durable_example;DROP keyspace durable_example; … Read more

Create Keyspace in Cassandra

Cassandra Create Keyspace To communicate with Cassandra the Cassandra Query Language (CQL) is used. A keyspace is an object working similar to an RDBMS database. It holds column families, the strategy used in the keyspace, indexes, user-defined types, replication factor, data centre awareness, etc. Syntax 1: To create keyspace: CREATE KEYSPACE <identifier> WITH <properties> Syntax … Read more

Alter Keyspace in Cassandra

Cassandra Alter Keyspace In a created keyspace, we can alter the replication factor, strategy name and the durable_writes properties using the “ALTER keyspace” command in Cassandra. Syntax 1: ALTER KEYSPACE WITH Syntax 2: ALTER KEYSPACE “KeySpace_Name” WITH replication = {‘class’: ‘Strategy name’, ‘replication_factor’: ‘No. Of replicas’}; Syntax 3: ALTER KEYSPACE Keyspace_Name with replication={‘class’:’Strategy_Name’, ‘replication_factor’: no … Read more

Cassandra CQLsh

Cassandra CQL shell or CQLsh is used to specify the way to use the Cassandra commands. Cassandra, when installed, provides a CQL shell prompt, to facilitate the users to communicate with it by executing the Cassandra commands on CQLsh.   CQLsh Options: Options Uses help To show help topics about the options of CQLsh commands. … Read more

Cassandra Data Model

The data model in Cassandra is different from RDBMS in many ways. A Cassandra Data Model contains the following elements: Cluster: A Cluster in Cassandra is the outermost container of the database. It contains one or more data centres. A data centre again acts as a collection of related nodes. With four nodes in a … Read more

Install Cassandra

Cassandra Installation Before installing Apache Cassandra, some prerequisites are required: The DataStax community edition. JDK installed. Window platform.   To Download and Install Cassandra: Open the DataStax community edition setup. Run the setup. Click on the Next button. Click again on the Next button. Confirm the location of the installation and then click on the … Read more

Difference between Cassandra and RDBMS

Cassandra vs RDBMS Cassandra RDBMS Deals with unstructured data. Deals with structured data. Flexible schema. Fixed schema. Table can be understood as a list of “nested key-value pairs”, i.e., Row x Column Key x Column value) Table can be understood as an array of arrays, i.e., Row x Column. Keyspace is the outermost container containing … Read more

Difference between Cassandra and HBase

Cassandra vs HBase Cassandra HBase Based on DynamoDB (Amazon). Based on Bigtable (Google). Many Cassandra deployments uses Cassandra + Storm (which uses zookeeper), and/or Cassandra + Hadoop. Uses the Hadoop infrastructure (Zookeeper, NameNode, HDFS). Uses a single node-type with each node performing same functions. Uses several “moving parts” consisting of Zookeeper, Name Node, HBase master, … Read more

Data Types in Cassandra

Cassandra Data Types: Below is a list of various data types supported in Cassandra. TYPE USES ASCII Used for US-ascii character string. BIGINT Used for 64-bit signed long. BLOB Used for Arbitrary bytes in hexadecimal. BOOLEAN Used for True or False. COUNTER Used for Distributed counter values 64 bit. DECIMAL Used for Variable precision decimal. … Read more

Cassandra Use Cases

Use cases of Cassandra can vary for different types of applications. Some of these are: Messaging: Cassandra can store hundreds of terabytes of data, and thus is best for the companies providing Mobile phones and messaging services. High speed Applications: With the feature of high speed data handling Cassandra is a preferred choice for the … Read more