Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Cassandra 3.x High Availability
  • Toc
  • feedback
Cassandra 3.x High Availability

Cassandra 3.x High Availability

By : Strickland
3.8 (6)
close
Cassandra 3.x High Availability

Cassandra 3.x High Availability

3.8 (6)
By: Strickland

Overview of this book

Apache Cassandra is a massively scalable, peer-to-peer database designed for 100 percent uptime, with deployments in the tens of thousands of nodes, all supporting petabytes of data. This book offers a practical insight into building highly available, real-world applications using Apache Cassandra. The book starts with the fundamentals, helping you to understand how Apache Cassandra’s architecture allows it to achieve 100 percent uptime when other systems struggle to do so. You’ll get an excellent understanding of data distribution, replication, and Cassandra’s highly tunable consistency model. Then we take an in-depth look at Cassandra's robust support for multiple data centers, and you’ll see how to scale out a cluster. Next, the book explores the domain of application design, with chapters discussing the native driver and data modeling. Lastly, you’ll find out how to steer clear of common anti-patterns and take advantage of Cassandra’s ability to fail gracefully.
Table of Contents (10 chapters)
close

Executing statements


While the Cluster acts as a central place to manage connection-level configuration options, you will need to establish a Session to perform actual work against the cluster. This is done by calling the connect() method on your Cluster instance.

To run the following examples, you will need to create the contacts keyspace and contact table, as follows:

CREATE KEYSPACE contacts  
WITH REPLICATION = { 
   'class' : 'SimpleStrategy',  
   'replication_factor' : 1 
}; 
 
USE contacts; 
 
CREATE TABLE contact ( 
   id UUID, 
   email TEXT PRIMARY KEY 
); 

After the schema is created, you can connect to the contacts keyspace:

private Session session; // defined at class level 
session = cluster.connect("contacts"); 

Once you have created the Session, you will be able to execute CQL statements, as follows:

String insert = "INSERT INTO contact (id, email) " + 
               "VALUES (" + 
               "bd297650-2885-11e4-8c21-0800200c9a66," + 
               "'[email protected]...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete