PROVIDER - Open Source Wide-Column DB

Apache Cassandra

Apache Cassandra is an open-source wide-column database hosted by the Apache Software Foundation, built on a masterless architecture with partition-key distribution, native multi-datacenter replication and vector search in 5.0.

Backend & Database United States 2026.11.27 53 views
4.4pts
Advertisement

Service Overview

Apache Cassandra is an open-source wide-column database hosted by the Apache Software Foundation. It uses a masterless peer-to-peer architecture with an LSM-Tree storage layer, places rows on nodes by partition key, and scales throughput horizontally with node count.

The project is governed by a community-elected PMC under the ASF bylaws and ships under Apache-2.0 from official repositories. DataStax DSE, Astra DB and cloud vendors' Keyspaces-class managed services are commercial distributions in the ecosystem, with pricing and support defined by each vendor. The product sits in the backend and database category.

Key Strengths

  • Any node serves reads and writes in the masterless design, so a single node failure does not stop the cluster.
  • Throughput scales horizontally with node count, from a three-node starter cluster to dozens of nodes.
  • Native multi-datacenter replication with consistency levels set per read and per write call.
  • Released under Apache-2.0, with CQL and official multilingual drivers that avoid application lock-in.
  • Version 5.0 ships storage-attached indexes, a vector data type and a unified compaction strategy.

Limitations

  • No JOIN and no cross-partition transactions, so related reads are assembled in the application layer.
  • Tables must be modelled around queries, and requirement changes usually mean new tables plus dual writes.
  • Self-hosting starts at three nodes with replication factor 3, while repairs and compaction need scheduled windows.
  • Consistency is eventual by default, and raising the level adds latency while narrowing the availability window.
  • Managed compatibility layers trim features: Keyspaces does not support materialized views or part of CQL.

Product Ecosystem

Apache Cassandra component layers and request path Client layer: drivers (Java / Python / Node.js / Go), cqlsh, Stargate REST and GraphQL Coordinator: any node accepts CQL, locates replicas by partition key, applies consistency Storage: commitlog, memtable, SSTable (LSM-Tree); compaction strategy drives write amplification Replication: multi-DC replicas, Hinted Handoff and Read Repair Self-hosted clusters start at three nodes with replication factor 3; managed services run repairs for you.
Figure 1: Apache Cassandra component layers and request path (compiled from the 5.0 official documentation)

Core Engine and Data Model

In CQL the partition key decides where a row lives and the clustering columns order rows inside a partition, so denormalization is the norm; nodes exchange state over Gossip and locate replicas by hashing the partition key, usually declaring replicas per datacenter with NetworkTopologyStrategy. Writes land in the commitlog and memtable before being flushed to immutable SSTables merged by the LSM-Tree, and 5.0 adds trie memtables, trie SSTables and the unified compaction strategy (UCS).

Drivers and Operations Tools

Official drivers exist for Java, Python, Node.js, Go and C#, all over the CQL binary protocol. cqlsh is the interactive shell, nodetool covers cluster status, repair, compaction and table statistics, fqltool replays captured production query logs, and Sidecar exposes management and observability endpoints for Kubernetes.

DataStax Distribution and Astra DB

DataStax ships the commercial DSE distribution and the Astra DB managed service, now part of IBM watsonx.data, metered in Resource Units with CQL, REST, GraphQL and vector search interfaces. Licensing, subscription and support for these lines are defined by DataStax and IBM, and they are not billed by the Apache project.

Cloud Vendor Managed Services

Amazon Keyspaces offers a CQL-compatible managed form that stores data across availability zones with replication factor 3, always writes at LOCAL_QUORUM and allows LOCAL_ONE or LOCAL_QUORUM reads. Other clouds mostly provide self-managed images or managed clusters, each trimming a different set of capabilities.

Kubernetes and Surrounding Ecosystem

K8ssandra and cass-operator handle deployment and lifecycle on Kubernetes, Stargate exposes REST, GraphQL and gRPC gateways, Medusa covers backup and Reaper schedules repairs. These components are separate open-source projects whose release cadence is not synchronized with the core engine.

Use Cases

  • Fit | Workloads located by partition key with steadily growing write volume, such as device time series, event streams and user activity tracking.
  • Fit | Multi-region active-active deployments that accept eventual consistency and read or write from the nearest datacenter.
  • Evaluate | Cases needing cross-partition joins, complex aggregation or ad-hoc reporting, which usually require a separate analytics pipeline.
  • Evaluate | Teams without dedicated operations staff, who must first price managed request volume or outsourced operations.

Pricing & Billing Selection

Billing mode / tier Reference price magnitude Capacity and billing rules Workload fit
Self-hosted, single node About $0.4-$0.6 / hour 64 GiB RAM / 8 vCPU / 200 GiB SSD; no licence fee under Apache-2.0, while block storage, backups and cross-region traffic follow the cloud bill Development and single-DC validation
Self-hosted, three-node cluster About $1.2-$1.8 / hour, roughly $880-$1,300 / month Replication factor 3, compute only; repair, compaction, monitoring and backup media are the operator's cost Production workloads with dedicated operations staff
Managed, on-demand mode (Amazon Keyspaces) Writes about $0.6-$0.7 / million WRU, reads about $0.1-$0.2 / million RRU, storage about $0.25 / GB-month 1 WRU per 1 KB row write, 1 RRU per 4 KB read, LOCAL_ONE reads at half rate; new accounts get 30M WRU, 30M RRU and 1 GB storage per month for the first three months Spiky CQL-compatible workloads that should stay serverless
Managed, provisioned mode (Amazon Keyspaces) About $0.0006-$0.0007 / WCU-hour, about $0.0001 / RCU-hour Billed per provisioned capacity hour, idle capacity included, and adjustable with auto scaling Steady writes with predictable throughput
Managed service, DataStax Astra DB (now IBM watsonx.data) Compute about $1 / RU, plus 3 RU/hour core support per account RU metered per second with a one-minute minimum; CQL, REST, GraphQL and vector search endpoints, priced by the vendor Teams without operations staff that need fast onboarding with vector search

Basis: (November 2026 list-price magnitude) self-hosted rows are converted from published memory-optimized instance prices and exclude backups, cross-region traffic and staff cost; managed rows use regional list prices, where reserved capacity and committed discounts differ; DataStax and cloud vendor charges are published by each vendor and are not Apache pricing.

FAQ

  • Q1: Where is the boundary between Cassandra and a relational database? Cross-partition joins, foreign keys or atomic transactions belong to relational systems. Cassandra targets workloads located by partition key with sustained write growth, trading denormalized tables and tunable consistency for horizontal scale, and complex aggregation usually runs in a separate analytics pipeline.
  • Q2: Is Apache Cassandra itself a paid product? No. The project is published by the Apache Software Foundation under Apache-2.0, and downloads, documentation and official drivers are free, with no commercial SLA from the foundation. DataStax DSE, Astra DB and cloud managed services are commercial distributions whose subscription and support prices are published by each vendor.
  • Q3: Does deploying Cassandra require identity verification or ICP filing? The open-source distribution involves no account or filing; self-hosting only needs servers you own or rent. Managed services follow the provider's account rules for verification and payment, and datacenters in mainland China additionally require ICP filing under local rules.
  • Q4: How do self-hosted and managed costs compare? Self-hosting bills machine hours and block storage, with a three-node cluster costing roughly a thousand dollars per month in compute before staffing. Managed services bill request units or provisioned capacity hours, writes cost under a dollar per million WRU, and on-demand mode tracks actual usage when traffic fluctuates.
  • Q5: Can existing MySQL or MongoDB data be migrated directly? Table structures cannot be reused as-is. CQL looks like SQL but has no JOIN, so migration means rebuilding tables around the new queries with dual writes for validation; historical data can move through the Spark connector or a bulk loader, then be sampled per partition key before cutover.

Integration & Code Examples

The CQL below runs in cqlsh or any driver session: create the keyspace first, then model the table around the query, with the partition key matching its equality filter.

CREATE KEYSPACE IF NOT EXISTS events
  WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': 3};

USE events;

CREATE TABLE IF NOT EXISTS timeline (
  device_id   uuid,
  event_time  timestamp,
  event_type  text,
  payload     text,
  PRIMARY KEY ((device_id), event_time)
) WITH CLUSTERING ORDER BY (event_time DESC)
  AND default_time_to_live = 7776000;

default_time_to_live expires time-series rows after 90 days without manual cleanup, and the descending clustering order makes "latest rows per device" cheap to read.

On the Python side the official cassandra-driver connects with LOCAL_QUORUM, which only counts replicas in the local datacenter and keeps write latency low across regions.

import os
import uuid
from datetime import datetime, timezone

from cassandra import ConsistencyLevel, ExecutionProfile
from cassandra.cluster import Cluster, EXEC_PROFILE_DEFAULT
from cassandra.policies import DCAwareRoundRobinPolicy, TokenAwarePolicy

profile = ExecutionProfile(
    load_balancing_policy=TokenAwarePolicy(DCAwareRoundRobinPolicy(local_dc="dc1")),
    consistency_level=ConsistencyLevel.LOCAL_QUORUM,
)
cluster = Cluster(
    contact_points=[os.environ["CASSANDRA_HOST"]],
    port=9042,
    execution_profiles={EXEC_PROFILE_DEFAULT: profile},
)
session = cluster.connect("events")

insert = session.prepare(
    "INSERT INTO timeline (device_id, event_time, event_type, payload) VALUES (?, ?, ?, ?)"
)
device = uuid.uuid4()
session.execute(insert, (device, datetime.now(timezone.utc), "temperature", '{"v":21.4}'))

for row in session.execute(
    "SELECT event_time, event_type FROM timeline WHERE device_id = %s LIMIT 5", (device,)
):
    print(row.event_time, row.event_type)

cluster.shutdown()

For local checks, the official image starts a single node, and nodetool reports status and repair progress; run production repairs per token range instead of one full repair that saturates I/O.

docker run --name cassandra-demo -p 9042:9042 -d cassandra:5.0

nodetool status
nodetool tablestats events.timeline
nodetool repair -pr events

-pr limits the repair to token ranges this node is the primary replica for, so each node in a multi-node cluster needs its own run to avoid leaving replicas inconsistent.

Community & Resources

Visit Apache Cassandra Website → https://cassandra.apache.org/
Visit Website ↗