Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Getting Started with Apache Cassandra

Getting Cassandra running takes about five minutes with Docker—the real learning curve is understanding how to use it effectively. Cassandra is not a drop-in replacement for PostgreSQL or MySQL; it requires a different mental model.

The core difference: in relational databases, the schema is designed first and queried as needed. In Cassandra, tables are designed around specific queries. This means denormalized tables, no JOINs, and knowing access patterns upfront. This is a trade-off—query flexibility is exchanged for more consistent performance characteristics, though actual performance depends on data model, partition sizing, and workload patterns.

This guide walks through installation, initial configuration, and initial queries.

What is Cassandra?Core concepts and use casesInstallationChoose an install methodFirst ClusterConfigure and start nodesCQL QuickstartWrite first queries

Choose the appropriate path:

Get Cassandra running in 5 minutes for development:

Terminal window
# Pull and run Cassandra
docker run --name cassandra -d -p 9042:9042 cassandra:latest
# Wait for startup (about 60 seconds)
sleep 60
# Connect with cqlsh
docker exec -it cassandra cqlsh

For production deployments, follow our detailed guides:

  1. Installation Overview - Various installation methods
  2. Cloud Deployment - AWS, GCP, Azure
  • What is Cassandra?
    • Core concepts and terminology
    • When to use Cassandra
    • Cassandra vs other databases
  • First Cluster Setup
    • Single-node development setup
    • Multi-node cluster configuration
    • Basic configuration options
  • CQL Tutorial
    • Connect to Cassandra
    • Create keyspaces and tables
    • Insert and query data
    • Basic operations
  • Production Checklist
    • Hardware requirements
    • Configuration recommendations
    • Security setup
    • Monitoring setup

Before diving in, familiarize yourself with these key concepts:

ConceptDescription
ClusterA collection of nodes that together store data
NodeA single Cassandra server instance
KeyspaceA namespace that defines data replication (like a database)
TableA collection of rows with a defined schema
Partition KeyDetermines which node stores the data
Clustering ColumnDetermines sort order within a partition
Replication FactorNumber of copies of data stored across nodes
Consistency LevelHow many replicas must respond for a successful operation

Here is what can be accomplished in the first 10 minutes:

Terminal window
# Using Docker
docker run --name my-cassandra -d -p 9042:9042 cassandra:5.0
Terminal window
# Wait for startup, then connect
docker exec -it my-cassandra cqlsh
CREATE KEYSPACE my_app WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': 1
};
USE my_app;
CREATE TABLE users (
user_id UUID PRIMARY KEY,
username TEXT,
email TEXT,
created_at TIMESTAMP
);
INSERT INTO users (user_id, username, email, created_at)
VALUES (uuid(), 'john_doe', 'john@example.com', toTimestamp(now()));
INSERT INTO users (user_id, username, email, created_at)
VALUES (uuid(), 'jane_smith', 'jane@example.com', toTimestamp(now()));
-- Get all users
SELECT * FROM users;
-- Get specific columns
SELECT username, email FROM users;

What is the minimum hardware for development?

Section titled “What is the minimum hardware for development?”

For development, Cassandra can run with:

  • 2 CPU cores
  • 4GB RAM (8GB recommended)
  • 10GB disk space

Should I use SimpleStrategy or NetworkTopologyStrategy?

Section titled “Should I use SimpleStrategy or NetworkTopologyStrategy?”
  • SimpleStrategy: Only for single-datacenter, development/testing
  • NetworkTopologyStrategy: Always use for production, even single DC

What is the difference between cqlsh and CQLAI?

Section titled “What is the difference between cqlsh and CQLAI?”
FeaturecqlshCQLAI
LanguagePythonGo (single binary)
AI Query GenerationNoYes
Tab CompletionBasicContext-aware
Output FormatsBasicTable, JSON, CSV, Parquet
DependenciesPython requiredNone

Learn more about CQLAI

After getting started:

  1. Learn Data Modeling - Design effective schemas
  2. Understand Architecture - How Cassandra works
  3. Explore CQL - Full query language reference
  4. Set Up Monitoring - Monitor the cluster