π Quick Setup Guide for ScyllaDB
ScyllaDB is a high-performance NoSQL database compatible with Apache Cassandra. Itβs ideal for applications that demand low latency and high throughput. This guide walks you through a quick setup of ScyllaDB using Docker for simplicity.
π§° Prerequisites
Before you begin, ensure you have the following installed:
- Docker (v20+ recommended)
- At least 2 CPU cores and 2GB RAM free
- Basic terminal/CLI knowledge
βοΈ Step-by-Step Setup Using Docker
1. Pull the ScyllaDB Docker Image
docker pull scylladb/scylla
2. Run a ScyllaDB Container
Start a single-node Scylla instance:
docker run --name scylla-node1 -d scylladb/scylla
For more control (e.g., data persistence or exposing ports):
docker run --name scylla-node1 \
-d --restart unless-stopped \
-p 9042:9042 -p 10000:10000 \
-v scylla-data:/var/lib/scylla \
scylladb/scylla
3. Verify the Container is Running
docker ps
You should see scylla-node1
running.
π§ͺ Connecting to ScyllaDB
You can use cqlsh
to interact with ScyllaDB:
Option 1: Use cqlsh from a Python container
docker run -it --rm --network host \
nuvo/docker-cqlsh:latest --cqlversion=3.4.5 \
<host-ip> 9042
Replace <host-ip>
with your Docker host IP (usually localhost
on Linux).
Option 2: Install cqlsh locally (via Cassandra tools)
Install Apache Cassandra tools, then run:
cqlsh localhost 9042
π Example CQL Commands
Once connected via cqlsh
, try the following:
CREATE KEYSPACE demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE demo;
CREATE TABLE users (
id UUID PRIMARY KEY,
name text,
email text
);
INSERT INTO users (id, name, email) VALUES (uuid(), 'Alice', 'alice@example.com');
SELECT * FROM users;
π Stopping and Cleaning Up
To stop and remove the container:
docker stop scylla-node1
docker rm scylla-node1
To remove the volume:
docker volume rm scylla-data
π Additional Resources
β
Conclusion
In just a few steps, you've set up a powerful NoSQL database ready for high-performance applications. ScyllaDB's speed and scalability make it a great choice for modern data workloads.
Happy hacking! π οΈ
Let me know if you want a Kubernetes-based guide or multi-node cluster setup.