docker.recipes

ScyllaDB Cluster

advanced

ScyllaDB high-performance Cassandra-compatible cluster.

Overview

ScyllaDB is a high-performance NoSQL database that reimplements Apache Cassandra in C++ instead of Java, delivering up to 10x better throughput and significantly lower latency. This revolutionary approach eliminates JVM garbage collection pauses and leverages a shard-per-core architecture that automatically tunes itself to the underlying hardware, making it ideal for applications requiring consistent low-latency performance at scale. This three-node ScyllaDB cluster configuration creates a distributed database system that provides fault tolerance and horizontal scalability while maintaining full Cassandra compatibility. The cluster uses a seed node topology where scylla-1 and scylla-2 serve as seed nodes for cluster discovery, while all three nodes participate in data replication and query processing. Each node is configured with resource constraints suitable for development and testing environments, using the overprovisioned flag to run efficiently on shared hardware. This setup is perfect for developers migrating from Cassandra who want dramatic performance improvements, organizations building real-time analytics platforms, or teams developing IoT applications that require consistent sub-millisecond response times. The cluster provides automatic data distribution, built-in replication, and the ability to handle millions of operations per second while maintaining the familiar CQL query interface that Cassandra developers already know.

Key Features

  • Cassandra-compatible CQL interface with 10x better performance
  • Shard-per-core architecture that eliminates lock contention
  • Automatic hardware tuning without manual configuration
  • Sub-millisecond P99 latency for real-time applications
  • Three-node cluster with automatic data replication and distribution
  • No JVM garbage collection pauses affecting query performance
  • Built-in cluster membership and failure detection
  • Compatible with existing Cassandra drivers and tools

Common Use Cases

  • 1Migrating existing Cassandra workloads for better performance
  • 2Real-time personalization engines requiring sub-millisecond response times
  • 3IoT data ingestion platforms handling millions of sensor readings
  • 4Gaming leaderboards and player state management systems
  • 5Time-series data storage for monitoring and observability platforms
  • 6Session storage for high-traffic web applications
  • 7Recommendation engines processing user behavior in real-time

Prerequisites

  • Minimum 8GB RAM available (2.25GB allocated to ScyllaDB cluster)
  • Docker Engine 20.10+ with sufficient memory limits configured
  • Port 9042 available for CQL client connections
  • Basic understanding of Cassandra data modeling concepts
  • Familiarity with CQL query syntax for database operations

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 scylla-1:
3 image: scylladb/scylla:latest
4 container_name: scylla-1
5 restart: unless-stopped
6 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
7 volumes:
8 - scylla1_data:/var/lib/scylla
9
10 scylla-2:
11 image: scylladb/scylla:latest
12 container_name: scylla-2
13 restart: unless-stopped
14 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
15 volumes:
16 - scylla2_data:/var/lib/scylla
17 depends_on:
18 - scylla-1
19
20 scylla-3:
21 image: scylladb/scylla:latest
22 container_name: scylla-3
23 restart: unless-stopped
24 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
25 ports:
26 - "${CQL_PORT:-9042}:9042"
27 volumes:
28 - scylla3_data:/var/lib/scylla
29 depends_on:
30 - scylla-2
31
32volumes:
33 scylla1_data:
34 scylla2_data:
35 scylla3_data:

.env Template

.env
1# ScyllaDB
2CQL_PORT=9042

Usage Notes

  1. 1CQL at localhost:9042
  2. 2Use cqlsh for queries
  3. 3Cassandra compatible
  4. 410x faster than Cassandra

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

scylla-1
scylla-1:
  image: scylladb/scylla:latest
  container_name: scylla-1
  restart: unless-stopped
  command: "--seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1"
  volumes:
    - scylla1_data:/var/lib/scylla
scylla-2
scylla-2:
  image: scylladb/scylla:latest
  container_name: scylla-2
  restart: unless-stopped
  command: "--seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1"
  volumes:
    - scylla2_data:/var/lib/scylla
  depends_on:
    - scylla-1
scylla-3
scylla-3:
  image: scylladb/scylla:latest
  container_name: scylla-3
  restart: unless-stopped
  command: "--seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1"
  ports:
    - ${CQL_PORT:-9042}:9042
  volumes:
    - scylla3_data:/var/lib/scylla
  depends_on:
    - scylla-2

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 scylla-1:
5 image: scylladb/scylla:latest
6 container_name: scylla-1
7 restart: unless-stopped
8 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
9 volumes:
10 - scylla1_data:/var/lib/scylla
11
12 scylla-2:
13 image: scylladb/scylla:latest
14 container_name: scylla-2
15 restart: unless-stopped
16 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
17 volumes:
18 - scylla2_data:/var/lib/scylla
19 depends_on:
20 - scylla-1
21
22 scylla-3:
23 image: scylladb/scylla:latest
24 container_name: scylla-3
25 restart: unless-stopped
26 command: --seeds=scylla-1,scylla-2 --smp 1 --memory 750M --overprovisioned 1
27 ports:
28 - "${CQL_PORT:-9042}:9042"
29 volumes:
30 - scylla3_data:/var/lib/scylla
31 depends_on:
32 - scylla-2
33
34volumes:
35 scylla1_data:
36 scylla2_data:
37 scylla3_data:
38EOF
39
40# 2. Create the .env file
41cat > .env << 'EOF'
42# ScyllaDB
43CQL_PORT=9042
44EOF
45
46# 3. Start the services
47docker compose up -d
48
49# 4. View logs
50docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/scylladb-cluster/run | bash

Troubleshooting

  • Node startup fails with memory errors: Increase Docker memory limit or reduce --memory parameter below 750M per node
  • Cluster nodes can't discover each other: Verify all containers are on the same Docker network and seed node names resolve correctly
  • CQL connection refused on port 9042: Wait 60-90 seconds for cluster initialization to complete before attempting connections
  • High CPU usage during startup: This is normal behavior as ScyllaDB performs automatic hardware detection and tuning
  • Data not replicating between nodes: Check that all three nodes show as 'UN' (Up/Normal) status in nodetool status output
  • Container restart loops: Verify sufficient disk space for data volumes and check ScyllaDB logs for configuration errors

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space