Apache Cassandra Hands-On Training Level One (2 days)
Recommended prerequisites: Experience with databases, application servers, and programming

Course summary: Created for people new to Cassandra, this high-quality, hands-on, project-based course takes people through the basics of working with Cassandra as they learn how to install Cassandra, define a database, create tables, insert, update, and delete data, and create an application, as well as create and modify a multiple-node cluster.

Unit 1: Understanding What Cassandra is For
Understanding What Cassandra is................................................................................ 1-2
Exercise: Access the Apache Cassandra website
Learning What Cassandra is Being Used For................................................................... 1-4
Exercise: Learn what Cassandra is being used for
Lab: Open the main course virtual machine

Unit 2: Getting Started with the Architecture
Understanding that Cassandra is a Distributed Database................................................. 2-2
Exercise: View Cassandra documentation
Learning What Snitch is For......................................................................................... 2-4
Learning What Gossip is For......................................................................................... 2-5
Exercise: Check your understanding
Learning How Data Gets Distributed and Replicated........................................................ 2-7
Exercise: Access related documentation
Lab: View the course projects

Unit 3: Installing Cassandra
Downloading Cassandra.............................................................................................. 3-2
Exercise: Locate the tarball
Ensuring Oracle Java 7 is Installed............................................................................... 3-4
Exercise: Check that Oracle Java 7 is installed
Installing Cassandra................................................................................................... 3-6
Exercise: Install Cassandra
Viewing the Main Configuration File.............................................................................. 3-8
Exercise: View the cassandra.yaml file
Providing Cassandra with Permission to Directories....................................................... 3-10
Exercise: Provide Cassandra with permission to directories
Starting Cassandra................................................................................................... 3-12
Exercise: Start Cassandra
Checking Status....................................................................................................... 3-15
Exercise: Check status
Accessing the Cassandra system.log File..................................................................... 3-17
Exercise: Access the Cassandra system.log file

Unit 4: Communicating with Cassandra
Understanding Ways to Communicate with Cassandra..................................................... 4-2
Exercise: View CQL commands
Using cqlsh............................................................................................................... 4-5
Exercise: Access cqlsh
Lab: Use cqlsh

Unit 5: Creating a Database
Understanding a Cassandra Database........................................................................... 5-2
Exercise: View the existing keyspaces
Defining a Keyspace................................................................................................... 5-4
Exercise: Define a keyspace
Lab: Create a second database

Unit 6: Creating a Table
Creating a Table........................................................................................................ 6-2
Exercise: Enter a keyspace
Defining Columns and Data Types................................................................................ 6-4
Exercise: Define columns and data types
Defining a Primary Key............................................................................................... 6-7
Exercise: Define a primary key
Recognizing a Partition Key........................................................................................ 6-10
Exercise: Recognize a partition key
Specifying a Descending Clustering Order.................................................................... 6-12
Exercise: Specify a descending clustering order
Lab: Create a second table

Unit 7: Inserting Data
Understanding Ways to Write Data............................................................................... 7-2
Using the INSERT INTO command................................................................................ 7-3
Exercise: Use the INSERT INTO command
Using the COPY command........................................................................................... 7-5
Exercise: Use the COPY command
Seeing How Data is Stored in Cassandra....................................................................... 7-8
Exercise: See how data is stored in Cassandra
Seeing How Data is Stored on Disk............................................................................. 7-12
Exercise: See how data is stored on disk
Lab: Insert data

Unit 8: Modeling Data
Understanding Data Modeling in Cassandra.................................................................... 8-2
Understanding Secondary Indexes................................................................................ 8-3
Exercise: Use a WHERE clause
Creating a Secondary Index......................................................................................... 8-8
Exercise: Create a secondary index
Defining a Composite Partition Key...............................................................................8-10
Exercise: Define a composite partition key

Unit 9: Creating an Application
Understanding Cassandra Drivers................................................................................. 9-2
Exercise: View the Cassandra drivers
Exploring the DataStax Java Driver............................................................................... 9-4
Exercise: Explore the DataStax Java driver
Setting Up a Development Environment........................................................................ 9-7
Exercise: Access a development environment
Creating an Application Page.......................................................................................9-11
Exercise: Create an application page
Getting the DataStax Java Driver Classes.................................................................... 9-16
Exercise: Get the DataStax Java driver classes
Connecting to a Cassandra Cluster.............................................................................. 9-22
Exercise: Connect to a Cassandra cluster
Executing a Query.................................................................................................... 9-25
Exercise: Execute a query
Displaying Query Results.......................................................................................... 9-29
Exercise: Display query results
Using an MVC Pattern............................................................................................... 9-38
Exercise: View an MVC pattern
Lab: Create a second application

Unit 10: Updating and Deleting Data
Updating Data......................................................................................................... 10-2
Exercise: Update data
Understanding How Updating Works........................................................................... 10-4
Exercise: Get an inside view into how updating works
Deleting Data.......................................................................................................... 10-7
Exercise: Delete data
Understanding Tombstones...................................................................................... 10-12
Exercise: View a tombstone
Using TTLs............................................................................................................. 10-16
Exercise: Create a TTL
Lab: Update and delete data

Unit 11: Selecting Hardware
Understanding Hardware Choices............................................................................... 11-2
Understanding RAM and CPU Recommendations........................................................... 11-3
Exercise: Check for RAM
Selecting Storage..................................................................................................... 11-6
Exercise: View available storage on your computer
Deploying in the Cloud.............................................................................................. 11-9
Exercise: View cloud recommendations

Unit 12: Adding Nodes to a Cluster
Understanding Cassandra Nodes................................................................................ 12-2
Exercise: Set up a second a node
Having a Network Connection.................................................................................... 12-5
Exercise: Have a network connection
Specifying the IP Address for a Node......................................................................... 12-13
Exercise: Specify the IP address for a node
Specifying Seed Nodes............................................................................................ 12-15
Exercise: Specify seed nodes
Bootstrapping a Node.............................................................................................. 12-18
Exercise: Bootstrap a node
Cleaning Up a Node................................................................................................ 12-21
Exercise: Clean up a node
Using cassandra-stress........................................................................................... 12-23
Exercise: Use cassandra-stress
Lab: Add a third node

Unit 13: Monitoring a Cluster
Understanding Cassandra Monitoring Tools.................................................................. 13-2
Using nodetool........................................................................................................ 13-3
Exercise: Use nodetool
Using JConsole........................................................................................................ 13-7
Exercise: Use JConsole
Learning About OpsCenter....................................................................................... 13-13
Exercise: Learn about OpsCenter

Unit 14: Repairing Nodes
Understanding Repair............................................................................................... 14-2
Exercise: Modify the replication factor of a keyspace
Repairing Nodes...................................................................................................... 14-4
Exercise: Repair nodes
Understanding Consistency....................................................................................... 14-6
Exercise: Specify consistency
Understanding Hinted Handoff................................................................................. 14-14
Understanding Read Repair...................................................................................... 14-15
Exercise: View read repair and hinted handoff settings
Lab: Repair nodes for a keyspace

Unit 15: Removing a Node
Understanding Removing a Node................................................................................ 15-2
Decommissioning a Node.......................................................................................... 15-3
Exercise: Decommission a node
Putting a Node Back into Service................................................................................ 15-5
Exercise: Put a node back into service
Removing a Dead Node............................................................................................. 15-8
Exercise: Remove a dead node
Lab: Put a node back into service

Unit 16: Redefining a Cluster for Multiple Data Centers
Redefining for Multiple Data Centers........................................................................... 16-2
Changing Snitch Type............................................................................................... 16-9
Exercise: Change snitch type
Modifying cassandra-rackdc.properties...................................................................... 16-11
Exercise: Modify cassandra-rackdc.properties
Changing Replication Strategy.................................................................................. 16-14
Exercise: Change replication strategy