Introduction to Cassandra for Developers

Introduction to Cassandra for Developers

Course Length: 3 days
Delivery Methods: Available as private class only
Course Benefits
  • Understand the needs that C* addresses
  • Be familiar with the operation and structure of C*
  • Be able to install and set up a C* database
  • Use the C* tools, including cqlsh, nodetool, and ccm (Cassandra Cluster Manager)
  • Be familiar with the C* architecture, and how a C* cluster is structured
  • Understand how data is distributed and replicated in a C* cluster
  • Understand core C* data modeling concepts, and use them to create well-structured data models
  • Use data replication and eventual consistency intelligently
  • Understand and use CQL to create tables and query for data
  • Know and use the CQL data types (numerical, textual, uuid, etc.)
  • Understand the various kinds of primary keys available (simple, compound, and composite primary keys)
  • Use more advanced capabilities like collections, counters, secondary indexes, CAS (Compare and Set), static columns, and batches
  • Be familiar with the Java client API
  • Use the Java client API to write client programs that work with C*
  • Build and use dynamic queries with QueryBuilder
  • Understand and use asynchronous queries with the Java API
Course Overview

This Introduction to Cassandra for Developers training class is technical and comprehensive, with a focus on the practical aspects of working with C*. Students learn to create data models with Cassandra and learn enough about the internal architecture to make good decisions. This class is hands-on, with plenty of labs. It covers CQL (Cassandra Query Language) in depth, as well as covering the Java API for writing Cassandra clients.

After taking this course, you will have learned what you need to productively work with Cassandra as well as guidelines for using it in an optimal manner. You'll also understand some of the "anti-patterns" that lead to non-optimal C* data models. You'll be familiar with CQL and with the Java client library, and be ready to work on production systems involving Cassandra.

This course includes coverage of Cassandra 3.x, but is also suitable for users of Cassandra 2. Features introduced in Cassandra 3 are clearly indicated.

Course Outline
  1. Cassandra Overview
    1. Why We Need Cassandra
    2. High level Cassandra Overview
    3. Cassandra Features
    4. Basic Cassandra Installation and Configuration
  2. Cassandra Architecture and CQL Overview
    1. Cassandra Architecture Overview
    2. Cassandra Clusters and Rings
    3. Data Replication in Cassandra
    4. Cassandra Consistency / Eventual Consistency
    5. Introduction to CQL
    6. Defining Tables with a Single Primary Key
    7. Using cqlsh for Interactive Querying
    8. Selecting and Inserting/Upserting Data with CQL
    9. Data Replication and Distribution
    10. Basic Data Types (including uuid, timeuuid)
  3. Data Modeling and CQL Core Concepts
    1. Defining a Compound Primary Key
    2. CQL for Compound Primary Keys
    3. Partition Keys and Data Distribution
    4. Clustering Columns
    5. Overview of Internal Data Organization
    6. Additional Querying Capabilities
    7. Result Ordering - ORDER BY and CLUSTERING ORDER BY
    8. UPDATE and DELETE Queries
    9. Result Filtering, ALLOW FILTERING
    10. Batch Queries
    11. Data Modeling Guidelines
    12. Denormalization
    13. Data Modeling Workflow
    14. Data Modeling Principles
    15. Primary Key Considerations
    16. Composite Partition Keys
    17. Defining with CQL
    18. Data Distribution with Composite Partition Key
    19. Overview of Internal Data Organization
  4. Additional CQL Capabilities
    1. Indexing
    2. Primary/Partition Keys and Pagination with token()
    3. Secondary Indexes and Usage Guidelines
    4. Cassandra Counters
    5. Counter Structure and Definition
    6. Using Counters
    7. Counter Limitations
    8. Cassandra collections
    9. Collection Structure and Uses
    10. Defining Collections (set, list, and map)
    11. Querying Collections (Including Insert, Update, Delete)
    12. Limitations
    13. Overview of Internal Storage Organization
    14. Static Column: Overview and Usage
    15. Static Column Guidelines
    16. Materialized View: Overview and Usage
    17. Materialized View Guidelines
  5. Data Consistency In Cassandra
    1. Overview of Consistency in Cassandra
    2. CAP Theorem
    3. Eventual (Tunable) Consistency in C* - ONE, QUORUM, ALL
    4. Choosing CL ONE
    5. Choosing CL QUORUM
    6. Achieving Immediate Consistency
    7. Using other Consistency Levels
    8. Internal Repair Mechanisms (Read Repair, Hinted Handoff)
    9. Lightweight Transactions (LWT)/ Compare and Set (CAS)
    10. Overview of Lightweight Transactions
    11. Using LWT, the [applied] Column
    12. IF EXISTS, IF NOT EXISTS, Other IF conditions
    13. Basic CAS Internals
    14. Overhead and Guidelines
  6. Practical Considerations
    1. Dealing with Write Failure
    2. Unavailable Nodes and Node Failure
    3. Requirements for Write Operations
    4. Key and Row Caches
    5. Cache Overview
    6. Usage Guidelines
    7. Multi-Data Center Support
    8. Overview
    9. Replication Factor Configuration
    10. Additional Consistency Levels - LOCAL/EACH QUORUM
    11. Deletes
    12. CQL for Deletion
    13. Tombstones
    14. Usage Guidelines
  7. The Java Client API
    1. API Overview
    2. Introduction
    3. Architecture and Features
    4. Connecting to a Cluster
    5. Cluster and Cluster.Builder
    6. Contact Points, Connecting to a Cluster
    7. Session Overview and API
    8. Working with Sessions
    9. The Query API
    10. Overview
    11. Dynamic Queries, Statement, SimpleStatement
    12. Processing Query Results, ResultSet, Row
    13. PreparedStatement, BoundStatement
    14. Binding Values and Querying with PreparedStatements
    15. CQL to Java Type Mapping
    16. Working with UUIDs
    17. Working with Time/Date Values
    18. Working with Batches of SimpleStatement and PreparedStatement
    19. Dynamic Queries and QueryBuilder
    20. QueryBuilder Overview and API
    21. Building SELECT, DELETE, INSERT, and UPDATE Queries
    22. Creating WHERE Clauses
    23. Other Query Examples
    24. Configuring Query Behavior
    25. Setting LIMIT and TTL
    26. Working with Consistency
    27. Using LWT
    28. Working with Driver Policies
    29. Load Balancing Policies - RoundRobinPolicy, DCAwareRoundRobinPolicy
    30. Retry Policies - DefaultRetryPolicy, DowngradingConsistencyRetryPolicy, Other Policies
    31. Reconnection Policies
    32. Asynchronous Querying Overview
    33. Synchronous vs. Asynchronous Querying
    34. Executing Asynchronous Queries
    35. java.util.concurrent.Future
    36. Cassandra ResultSetFuture
    37. Future Result Processing
Class Materials

Each student will receive a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following is required for this Apache Cassandra class:

  • Reasonable Java experience for the Java driver labs, some knowledge of databases .
Request a Private Class
  • Private Class for your Team
  • Online or On-location
  • Customizable
  • Expert Instructors
Request Pricing