Shared-nothing per core is the whole design. ScyllaDB starts one shard per CPU core. Each shard owns a disjoint slice of the node's data and a disjoint slice of its memory, runs its own event loop, and schedules its own I/O. There are no locks between shards and no shared mutable state - when shard 3 needs something shard 7 owns, it sends a message.
Three things follow, and they are what the course is about.
No JVM, so no garbage collection pauses. In Cassandra, a stop-the-world pause is the most common cause of a p99 that is twenty times the p50, and tuning it is a specialism. Here the memory is managed explicitly in C++. Tail latency still exists - from I/O, from compaction, from a saturated shard - but the single largest and least tractable source is gone.
The shard is the unit of capacity. A partition belongs to exactly one shard on each replica. So a hot partition does not spread its load across the node's cores - it saturates one core, and the node's average CPU looks fine. This is the single most important operational difference from Cassandra: a dashboard showing per-node averages will show you a healthy 25% CPU while one shard is pinned at 100% and your p99 is terrible.
The driver can route to the shard. Cassandra drivers are token-aware: they pick a replica node. ScyllaDB's drivers are additionally shard-aware: they compute which shard owns the key and open a connection that lands on that core, so the request is handled without an inter-shard hop. It is a measurable win and it only works with a shard-aware driver, correctly configured - so verifying it is a real task.
The compatibility boundary. ScyllaDB implements CQL, the native protocol, and the Thrift and Alternator (DynamoDB) APIs. The data model, drivers and most nodetool commands carry over. Where it differs:
- There is no JVM, so nothing JVM-related transfers: no heap tuning, no GC flags, no JMX in the same form.
nodetoolworks through ScyllaDB's own interfaces. - Far fewer knobs, deliberately. ScyllaDB auto-tunes memory, I/O scheduling and compaction concurrency, and
scylla_setupbenchmarks your disk at install time to calibrate the I/O scheduler. The guidance is genuinely to leave most settings alone, which is a different operational posture from Cassandra. - Some features arrived later or differ: materialized views, secondary indexes (global, unlike Cassandra's local ones), CDC, and the specifics of LWT. Check the current version's documentation rather than assuming parity in either direction.
- Configuration file names and some option names differ, even where the meaning is the same.
- Alternator is a DynamoDB-compatible API, which is unique here and worth knowing exists.
Laboratory exercise 1 - provision and verify.
Stand up a three-node cluster, each with at least two shards, and get the ScyllaDB Monitoring Stack running against it. The monitoring is a deliverable, not a convenience - Module 4 depends on it.
Record: the version, the shard count per node (nodetool status plus the per-shard metrics), the memory assigned per shard, the I/O scheduler calibration from scylla_setup, and the replication settings.
Load at least two million rows modelling the capstone's game event store, with a time-bucketed partition key.
Then demonstrate the shard model, which is the point of the module: pick one partition, determine which shard owns it on each replica (from the metrics or nodetool), then drive heavy traffic at that single partition and show one shard's CPU at or near 100% while the node average stays low. Capture both graphs. This is the demonstration that reframes everything else.
Then demonstrate shard-aware routing: run a benchmark with a shard-aware driver, then with shard awareness disabled, and record the p99 difference and the per-shard connection counts.
Finally, run the compatibility checks: confirm your Cassandra driver connects, and record three things that differ from your Cassandra setup.
Deliverable: an idempotent setup script, a README including the flags and why each matters, the monitoring stack running with a screenshot of per-shard CPU, the shard ownership mapping, the hot-shard demonstration with both graphs, the shard-aware routing comparison, and the three recorded differences.
-- ------------------------------------------------------------------
-- Starting it, and THE FLAGS THAT MATTER.
-- ------------------------------------------------------------------
-- docker run --name scylla1 -d \
-- scylladb/scylla:6.0 \
-- --smp 2 \ # SHARDS = cores to use
-- --memory 2G \
-- --overprovisioned 1 \ # *** ESSENTIAL on a laptop or in
-- # Docker ***
-- --developer-mode 1 # skips production disk checks
--
-- WHY --overprovisioned MATTERS: ScyllaDB's DEFAULT ASSUMPTION IS
-- THAT IT OWNS THE MACHINE. It pins threads to cores, polls rather
-- than waiting on interrupts, and reserves memory per shard. On
-- shared hardware without this flag it fights your other processes
-- for CPU and the latency numbers you measure are meaningless.
-- In production on dedicated hardware: omit it, and run
-- scylla_setup, which benchmarks the disk to calibrate the I/O
-- scheduler.
-- nodetool status
-- Datacenter: datacenter1
-- -- Address Load Tokens Owns Host ID Rack
-- UN 172.17.0.2 1.02 GB 256 ? ... rack1
-- UN 172.17.0.3 1.01 GB 256 ? ... rack1
-- UN 172.17.0.4 1.03 GB 256 ? ... rack1
SELECT cluster_name, release_version, cql_version FROM system.local;
-- release_version shows the CASSANDRA version ScyllaDB reports for
-- compatibility; the real version is in:
-- curl -s http://localhost:10000/storage_service/scylla_release_version
-- Shard count and per-shard memory - the numbers to record:
-- curl -s http://localhost:9180/metrics | grep -E '^scylla_reactor_utilization'
-- scylla_reactor_utilization{shard="0"} 0.12
-- scylla_reactor_utilization{shard="1"} 0.14
-- ^^^^^^^^^ PER SHARD. Everything in
-- Module 4 is read this way.
-- ------------------------------------------------------------------
-- The model carries over from Cassandra. Exactly.
-- ------------------------------------------------------------------
CREATE KEYSPACE IF NOT EXISTS game
WITH replication = {'class': 'NetworkTopologyStrategy',
'datacenter1': 3};
USE game;
CREATE TABLE events_by_player_hour (
player_id uuid,
day date,
hour int,
event_at timestamp,
event_id timeuuid,
kind text,
payload text,
PRIMARY KEY ((player_id, day, hour), event_at, event_id)
-- ^^^^^^^^^^^^^^^^^^^^^^ the partition key -> a token
-- -> which NODES hold it, AND WHICH SHARD on each
) WITH CLUSTERING ORDER BY (event_at DESC, event_id DESC)
AND compaction = {'class': 'TimeWindowCompactionStrategy',
'compaction_window_unit': 'HOURS',
'compaction_window_size': 6}
AND default_time_to_live = 604800
AND gc_grace_seconds = 86400;
-- All of that is Cassandra knowledge, unchanged. Bounded
-- partitions, TWCS for TTL time-series, gc_grace above the repair
-- interval. The data modelling course was the Cassandra course.
-- ------------------------------------------------------------------
-- *** THE SHARD IS THE UNIT OF CAPACITY. *** The point of Module 1.
-- ------------------------------------------------------------------
-- A partition belongs to EXACTLY ONE SHARD on each replica. So a hot
-- partition does NOT spread across the node's cores - it saturates
-- ONE CORE, and the NODE AVERAGE LOOKS FINE.
--
-- node CPU average 26% <- "we have plenty of headroom"
-- shard 0 reactor_utilization 0.99 <- the actual problem
-- shard 1 reactor_utilization 0.08
-- shard 2 reactor_utilization 0.07
-- shard 3 reactor_utilization 0.06
--
-- *** A DASHBOARD SHOWING PER-NODE AVERAGES WILL HIDE THIS
-- *** COMPLETELY. *** It is the single most important operational
-- difference from Cassandra, and the lab demonstration that reframes
-- everything else in the course.
--
-- Which shard owns a key:
-- nodetool getendpoints game events_by_player_hour 7f3c...
-- -> the replica NODES
-- and the shard is derived from the token the same way the driver
-- derives it - visible in the Monitoring Stack's per-shard panels
-- when you drive traffic at one partition.
-- ------------------------------------------------------------------
-- SHARD-AWARE ROUTING. Verify it; do not assume it.
-- ------------------------------------------------------------------
-- Cassandra drivers: TOKEN-aware -> pick the right NODE.
-- ScyllaDB drivers: also SHARD-aware -> open a connection that
-- lands on the right CORE, so there is NO
-- INTER-SHARD HOP.
--
-- The shard-aware drivers:
-- scylla-driver (Python), gocql fork, Java 4.x scylla,
-- cpp-driver, rust-driver, nodejs
-- ScyllaDB advertises a shard-aware port (19042) and the driver
-- uses source-port selection to land on a chosen shard.
--
-- VERIFY IT:
-- curl -s http://localhost:9180/metrics | grep scylla_transport_cql_connections
-- -> connections distributed EVENLY across shards = shard-aware
-- -> all on shard 0 = NOT shard-aware, and every request pays an
-- inter-shard hop
--
-- Measure it: the same benchmark with a shard-aware driver and
-- with a plain Cassandra driver. Record the p99 difference. It is
-- not subtle.
-- ------------------------------------------------------------------
-- THE COMPATIBILITY BOUNDARY.
-- ------------------------------------------------------------------
-- WHAT CARRIES OVER: the data model, CQL, the native protocol, the
-- drivers, most nodetool commands, consistency levels, LSM storage,
-- tombstones, gc_grace_seconds, repair.
--
-- WHERE IT DIFFERS:
-- 1. NO JVM. So nothing JVM-related transfers: no heap tuning, no
-- GC flags, no JMX in the same form. nodetool works through
-- ScyllaDB's own REST interface.
--
-- 2. FAR FEWER KNOBS, DELIBERATELY. ScyllaDB auto-tunes memory,
-- I/O scheduling and compaction concurrency; scylla_setup
-- benchmarks your disk at install time to calibrate the I/O
-- scheduler. THE GUIDANCE IS GENUINELY TO LEAVE MOST SETTINGS
-- ALONE - a different operational posture from Cassandra, where
-- tuning is expected.
-- cat /etc/scylla/scylla.yaml
-- cat /etc/scylla.d/io_properties.yaml <- the calibration
--
-- 3. SOME FEATURES DIFFER. Notably SECONDARY INDEXES HERE ARE
-- GLOBAL, not local as in Cassandra (Module 2) - a real
-- improvement. Materialized views, CDC and LWT specifics also
-- differ. CHECK THE CURRENT VERSION'S DOCUMENTATION rather than
-- assuming parity in either direction.
--
-- 4. CONFIGURATION FILE AND OPTION NAMES differ, even where the
-- meaning is the same.
--
-- 5. ALTERNATOR: a DynamoDB-compatible API, unique to ScyllaDB.
-- Worth knowing it exists.
-- --alternator-port 8000 --alternator-write-isolation always
-- Run the compatibility checks and RECORD what differs. "It is
-- CQL-compatible" is a claim to test (Module 6), not to accept.
Discussion
No questions on this topic yet. Sign in to ask the first one.