docker.recipes

ScyllaDB Cluster

intermediate

High-performance Cassandra-compatible NoSQL database written in C++.

Overview

ScyllaDB is a high-performance NoSQL database written in C++ that provides full compatibility with Apache Cassandra while delivering significantly better performance characteristics. Originally developed by Avi Kivity and the team at ScyllaDB, it reimplements Cassandra's functionality using modern C++ techniques and a shard-per-core architecture that eliminates the overhead of Java Virtual Machine garbage collection. ScyllaDB maintains wire protocol compatibility with Cassandra, meaning existing applications and drivers can connect without modification while benefiting from 10x better throughput and dramatically reduced P99 latencies. This cluster configuration deploys a two-node ScyllaDB setup that demonstrates distributed wide-column storage capabilities with automatic data replication and partition tolerance. The nodes communicate through a dedicated bridge network and use seed-based discovery to form a cohesive cluster that can handle node failures gracefully. The configuration includes memory and CPU constraints suitable for development environments while maintaining the core distributed database functionality that makes ScyllaDB attractive for production workloads. This setup is ideal for developers migrating from Cassandra who want to experience ScyllaDB's performance benefits, teams building real-time analytics platforms that require low-latency data access, and organizations evaluating modern NoSQL alternatives that can scale horizontally while maintaining strong consistency guarantees.

Key Features

  • Cassandra CQL compatibility with existing drivers and applications
  • C++ implementation delivering 10x better performance than Java-based Cassandra
  • Shard-per-core architecture eliminating JVM garbage collection overhead
  • Automatic cluster formation using seed-based node discovery
  • Multi-node data replication with configurable consistency levels
  • Wide-column data model supporting flexible schema evolution
  • Built-in nodetool compatibility for cluster monitoring and maintenance
  • DynamoDB-compatible API support for cloud migration scenarios

Common Use Cases

  • 1Migrating existing Cassandra applications to gain 10x performance improvements
  • 2Real-time analytics platforms requiring sub-millisecond query response times
  • 3IoT data ingestion systems handling millions of time-series data points
  • 4Gaming backends storing player profiles and session data with low latency
  • 5Content management systems serving personalized recommendations at scale
  • 6Financial services applications tracking transactions with high availability requirements
  • 7Development environments for testing distributed database applications locally

Prerequisites

  • Minimum 4GB RAM available to Docker (750MB allocated per node plus overhead)
  • Docker Engine 20.10+ with Docker Compose v2 support
  • Basic understanding of NoSQL concepts and CQL query language
  • Familiarity with distributed database concepts like eventual consistency
  • Network ports 9042 (CQL) and 9160 (Thrift) available on host system
  • SSD storage recommended for optimal performance in production deployments

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 scylla1:
3 image: scylladb/scylla:latest
4 container_name: scylla1
5 command: --seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1
6 volumes:
7 - scylla1_data:/var/lib/scylla
8 ports:
9 - "9042:9042"
10 - "9160:9160"
11 networks:
12 - scylla-network
13
14 scylla2:
15 image: scylladb/scylla:latest
16 container_name: scylla2
17 command: --seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1
18 volumes:
19 - scylla2_data:/var/lib/scylla
20 depends_on:
21 - scylla1
22 networks:
23 - scylla-network
24
25volumes:
26 scylla1_data:
27 scylla2_data:
28
29networks:
30 scylla-network:
31 driver: bridge

.env Template

.env
1# ScyllaDB optimized for containers

Usage Notes

  1. 1Docs: https://docs.scylladb.com/
  2. 2CQL port 9042 | Thrift port 9160 (legacy)
  3. 3Connect: docker exec -it scylla1 cqlsh
  4. 410x faster than Apache Cassandra - C++ vs Java
  5. 5Drop-in Cassandra replacement - same CQL and drivers
  6. 6Monitor: docker exec -it scylla1 nodetool status

Individual Services(2 services)

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

scylla1
scylla1:
  image: scylladb/scylla:latest
  container_name: scylla1
  command: "--seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1"
  volumes:
    - scylla1_data:/var/lib/scylla
  ports:
    - "9042:9042"
    - "9160:9160"
  networks:
    - scylla-network
scylla2
scylla2:
  image: scylladb/scylla:latest
  container_name: scylla2
  command: "--seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1"
  volumes:
    - scylla2_data:/var/lib/scylla
  depends_on:
    - scylla1
  networks:
    - scylla-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 scylla1:
5 image: scylladb/scylla:latest
6 container_name: scylla1
7 command: --seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1
8 volumes:
9 - scylla1_data:/var/lib/scylla
10 ports:
11 - "9042:9042"
12 - "9160:9160"
13 networks:
14 - scylla-network
15
16 scylla2:
17 image: scylladb/scylla:latest
18 container_name: scylla2
19 command: --seeds=scylla1 --smp 1 --memory 750M --overprovisioned 1
20 volumes:
21 - scylla2_data:/var/lib/scylla
22 depends_on:
23 - scylla1
24 networks:
25 - scylla-network
26
27volumes:
28 scylla1_data:
29 scylla2_data:
30
31networks:
32 scylla-network:
33 driver: bridge
34EOF
35
36# 2. Create the .env file
37cat > .env << 'EOF'
38# ScyllaDB optimized for containers
39EOF
40
41# 3. Start the services
42docker compose up -d
43
44# 4. View logs
45docker 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/run | bash

Troubleshooting

  • Container exits with 'Not enough memory' error: Increase Docker's memory limit to at least 4GB total
  • CQL connection refused on port 9042: Wait 60-90 seconds for cluster initialization to complete
  • Nodes show as DOWN in nodetool status: Check inter-node connectivity on the scylla-network bridge
  • High CPU usage during startup: Normal behavior as ScyllaDB performs auto-tuning and optimization
  • Volume mount permission errors: Ensure Docker has proper access to volume mount directories
  • Seed node discovery failures: Verify scylla1 container starts first and maintains stable networking

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

Components

scylladb

Tags

#scylladb#cassandra#nosql#wide-column#performance

Category

Database Stacks
Ad Space