Authentication, authorisation and the system_auth trap are as in Cassandra. Off by default; PasswordAuthenticator and CassandraAuthorizer to enable; and system_auth defaults to a replication factor that will lock users out when a node is down, so raise it and repair it. The role model, the permissions and the AUTHORIZE-is-dangerous rule all carry over. Service levels from Module 4 attach to roles, which makes the role design and the workload design the same design.
TLS has the same two configurations - client-to-node and node-to-node - with ScyllaDB's own option names. Inter-node encryption matters as much as client encryption, for the same reason.
Monitoring is where this course differs most from Cassandra's. The ScyllaDB Monitoring Stack is Prometheus, Alertmanager and Grafana with ScyllaDB's own dashboards, and its per-shard panels are not a nicety - they are the only way to see most of what Module 4 taught. The metrics to alert on, with the ScyllaDB-specific ones marked:
- Per-shard reactor utilisation and scheduler queue length - specific. A single saturated shard is invisible in node averages.
- Cache hit ratio - specific. A falling ratio means the working set has outgrown memory, and here that is not gradual.
- Coordinator against replica latency p99 - specific in its usefulness.
- Service level runtime per group - specific, if you use workload prioritisation.
- Pending compactions, dropped messages, hints, tombstones per read, SSTables per read - as Cassandra.
- Repair recency per node - the
gc_grace_secondscontract. - Clock offset - a correctness metric.
- Disk usage against the compaction headroom, which ICS reduces but does not remove.
Sizing has a ScyllaDB-specific shape. Memory per shard is the node's memory divided by shard count, and ScyllaDB wants a meaningful amount per shard - the documentation's guidance is a real constraint, not advice, and running too many shards on too little memory produces a cluster that evicts constantly. Cores matter more than in Cassandra because they are the unit of parallelism; disk should be fast, and scylla_setup's I/O calibration means a slow disk is measured and respected rather than guessed at. The per-node data ceiling is higher than Cassandra's - ScyllaDB handles denser nodes - but repair and replacement times still scale with it.
Migration compatibility testing is the module's distinctive content, because "it is CQL-compatible" is a claim and not a plan. The tests that matter: schema round-trip (export from Cassandra, apply to ScyllaDB, compare); every query your application actually issues, with results compared row by row; the driver, because a Cassandra driver works and a shard-aware one performs; features you may be relying on that differ (materialized views, secondary index semantics, LWT behaviour, UDFs, triggers if anyone used them); and the operational tooling, because your runbooks reference nodetool output and JMX that may have changed shape. sstableloader and ScyllaDB's migration tooling handle the data; the testing is what makes the cutover safe.
Laboratory exercise 6 - make it defensible.
Enable authentication and authorisation, fix system_auth replication, and demonstrate the lockout trap both ways as in the Cassandra course.
Implement least privilege: an application role with SELECT and MODIFY on only its tables; a read-only reporting role attached to the analytics service level; and an operations role with DESCRIBE and no data access. Test every denial, and show the service level attachment taking effect.
Configure client-to-node and node-to-node TLS and verify the inter-node encryption with a packet capture.
Build the full monitoring configuration with every metric above and a threshold for each, including at least two alerts that could only be written with per-shard data.
Produce a measured sizing plan: data per row, replication factor, shard count, memory per shard, compaction headroom under ICS, and the resulting node specification.
Then the migration compatibility test suite, which is the deliverable that matters: run your Cassandra schema and every application query against both engines and compare results; test both drivers; and enumerate every difference you find, including operational ones.
Deliverable: the security configuration, the system_auth trap demonstrated and fixed, the role and service level definitions, a test script attempting every forbidden operation with its output, the TLS verification, the alert definitions including the per-shard ones, the measured sizing plan, and the migration compatibility report with every difference enumerated.
-- ==================================================================
-- AUTHENTICATION, AUTHORISATION, AND THE SAME system_auth TRAP.
-- ==================================================================
-- scylla.yaml:
-- authenticator: PasswordAuthenticator
-- authorizer: CassandraAuthorizer
-- permissions_validity_in_ms: 10000
SELECT keyspace_name, replication FROM system_schema.keyspaces
WHERE keyspace_name = 'system_auth';
-- *** If this is RF=1, a user whose credentials live on the down
-- *** node CANNOT LOG IN ANYWHERE - during the incident when you
-- *** most need to. The same trap as Cassandra. ***
ALTER KEYSPACE system_auth WITH replication = {
'class': 'NetworkTopologyStrategy', 'dc1': 3 };
-- then: sctool repair -c production --keyspace system_auth
-- (or: nodetool repair system_auth)
CREATE ROLE admin WITH PASSWORD = 'Str0ng#Admin'
AND LOGIN = true AND SUPERUSER = true;
ALTER ROLE cassandra WITH PASSWORD = '<long random>' AND LOGIN = false;
-- ==================================================================
-- Roles, and the fact that SERVICE LEVELS ATTACH TO ROLES.
-- ==================================================================
CREATE ROLE game_writer WITH LOGIN = false;
GRANT SELECT, MODIFY ON TABLE game.events_by_player_hour TO game_writer;
GRANT SELECT, MODIFY ON TABLE game.players TO game_writer;
-- MODIFY covers INSERT, UPDATE and DELETE. No separate DELETE
-- permission, as in Cassandra.
CREATE ROLE reporting WITH LOGIN = false;
GRANT SELECT ON KEYSPACE game TO reporting;
CREATE ROLE game_ops WITH LOGIN = false;
GRANT DESCRIBE ON ALL KEYSPACES TO game_ops; -- schema, NO DATA
CREATE ROLE game_app WITH PASSWORD = 'Str0ng#App' AND LOGIN = true;
GRANT game_writer TO game_app;
CREATE ROLE reporting_user WITH PASSWORD = 'Str0ng#Rep' AND LOGIN = true;
GRANT reporting TO reporting_user;
-- *** THE ROLE DESIGN AND THE WORKLOAD DESIGN ARE THE SAME DESIGN. ***
ATTACH SERVICE LEVEL interactive TO game_app;
ATTACH SERVICE LEVEL analytics TO reporting_user;
LIST EFFECTIVE SERVICE LEVEL OF reporting_user;
-- Which means: who a connection authenticates as decides how much
-- of the cluster it may consume. That is a security and a capacity
-- control in one, and it is worth saying out loud.
-- NEVER grant AUTHORIZE to an application role - it lets a role
-- grant permissions, including to itself.
LIST ALL PERMISSIONS OF game_app;
-- VERIFY THE DENIALS. Every one must fail:
-- cqlsh -u game_app -p ...
-- DROP TABLE game.players; -> Unauthorized
-- SELECT * FROM system_auth.roles; -> Unauthorized
-- GRANT SELECT ON KEYSPACE game TO game_app; -> Unauthorized
-- CREATE SERVICE LEVEL cheat WITH shares=1000; -> Unauthorized
-- ==================================================================
-- TLS: two configurations, ScyllaDB's option names.
-- ==================================================================
-- scylla.yaml:
-- client_encryption_options:
-- enabled: true
-- certificate: /etc/scylla/db.crt
-- keyfile: /etc/scylla/db.key
-- truststore: /etc/scylla/ca.pem
-- require_client_auth: true
--
-- server_encryption_options: # NODE <-> NODE
-- internode_encryption: all # none | dc | rack | all
-- certificate: /etc/scylla/db.crt
-- keyfile: /etc/scylla/db.key
-- truststore: /etc/scylla/ca.pem
--
-- Inter-node encryption matters as much as client encryption - it
-- carries all your data between hosts, and between sites in a
-- multi-DC deployment. VERIFY WITH A PACKET CAPTURE.
-- cqlsh --ssl
-- ==================================================================
-- MONITORING: the per-shard alerts are the ones that matter.
-- ==================================================================
-- git clone github.com/scylladb/scylla-monitoring
-- ./start-all.sh -d prometheus-data -s scylla_servers.yml
-- -> Prometheus + Alertmanager + Grafana with ScyllaDB's own
-- dashboards. NOT a nicety: the per-shard panels are the only
-- way to see most of Module 4.
--
-- *** SCYLLADB-SPECIFIC ALERTS - write at least two of these: ***
--
-- 1. ANY SHARD saturated while the node looks healthy:
-- max by (instance) (scylla_reactor_utilization) > 0.9
-- and on(instance) avg by (instance)(scylla_reactor_utilization) < 0.5
-- -> a hot partition. INVISIBLE to a node-average alert.
--
-- 2. a shard's scheduler QUEUE growing:
-- scylla_scheduler_queue_length{group="statement"} > 100
--
-- 3. CACHE HIT RATIO falling:
-- 1 - rate(scylla_cache_reads_with_misses[5m])
-- / rate(scylla_cache_reads[5m]) < 0.8
-- -> the working set has outgrown memory, and here that is NOT
-- gradual.
--
-- 4. coordinator p99 high while replica p99 is low -> network or
-- a slow node, not the shard
--
-- 5. service level starvation:
-- rate(scylla_scheduler_runtime_ms{group="sl:interactive"}[5m])
-- falling while analytics rises
--
-- AND, as Cassandra:
-- pending compactions growing, dropped messages > 0, hints not
-- delivered, tombstones per read, SSTables per read p99,
-- REPAIR RECENCY PER NODE (the gc_grace contract),
-- CLOCK OFFSET (a correctness metric),
-- disk vs compaction headroom (ICS reduces it, not removes it)
-- ==================================================================
-- SIZING: the ScyllaDB-specific shape.
-- ==================================================================
-- MEMORY PER SHARD = node memory / shard count, and *** ScyllaDB
-- WANTS A MEANINGFUL AMOUNT PER SHARD. *** The documented minimum
-- is a REAL CONSTRAINT, not advice: too many shards on too little
-- memory produces a cluster that EVICTS CONSTANTLY and whose cache
-- hit ratio never recovers.
-- 32 GB node / 8 shards = 4 GB per shard fine
-- 16 GB node / 16 shards = 1 GB per shard too thin
--
-- CORES matter more than in Cassandra - they ARE the unit of
-- parallelism, so core count is capacity, not just throughput.
--
-- DISK: fast, and scylla_setup's I/O calibration MEASURES it, so a
-- slow disk is respected rather than guessed at.
-- cat /etc/scylla.d/io_properties.yaml
--
-- PER-NODE DATA CEILING is HIGHER than Cassandra's - ScyllaDB
-- handles denser nodes - but repair and replacement times still
-- scale with it. Size for the replacement you are willing to wait
-- for.
--
-- measured example:
-- 800 bytes/row x 20,000,000,000 rows = 16 TB logical
-- x RF 3 = 48 TB replicated
-- + ICS headroom (~20%, vs 50% STCS) = 58 TB
-- / 4 TB per node = 15 nodes
-- each: 16 cores (16 shards), 128 GB (8 GB/shard), NVMe
-- ==================================================================
-- *** MIGRATION COMPATIBILITY TESTING. *** The distinctive content.
-- ==================================================================
-- "It is CQL-compatible" is A CLAIM, NOT A PLAN. The tests:
--
-- 1. SCHEMA ROUND-TRIP
-- cqlsh (Cassandra) -e "DESC KEYSPACE game" > cassandra.cql
-- cqlsh (ScyllaDB) -f cassandra.cql
-- cqlsh (ScyllaDB) -e "DESC KEYSPACE game" > scylla.cql
-- diff cassandra.cql scylla.cql
-- -> record every difference. Some are cosmetic; some are not.
--
-- 2. EVERY QUERY YOUR APPLICATION ACTUALLY ISSUES, with results
-- COMPARED ROW BY ROW against the same data. Not a sample of
-- queries - the actual set, from your code or from a captured
-- query log.
--
-- 3. THE DRIVER. A Cassandra driver WORKS; a SHARD-AWARE one
-- PERFORMS. Test both, and measure the difference, because the
-- migration's performance case may depend on it.
--
-- 4. FEATURES THAT DIFFER - test each one you rely on:
-- materialized views semantics and consistency
-- secondary indexes GLOBAL here vs LOCAL there: query
-- plans and costs change
-- LWT performance and edge behaviour
-- UDFs / UDAs support differs
-- triggers if anyone used them
-- counters behaviour under failure
--
-- 5. OPERATIONAL TOOLING. Your runbooks reference nodetool output
-- and JMX that MAY HAVE CHANGED SHAPE. Every runbook that parses
-- command output needs re-testing.
--
-- THE DATA MOVE itself:
-- sstableloader -d <scylla-node> /path/to/cassandra/data/game/table
-- or ScyllaDB's migration tooling / spark-based migrator for a
-- live dual-write cutover.
--
-- The data move is the easy part. THE TESTING IS WHAT MAKES THE
-- CUTOVER SAFE.
Discussion
No questions on this topic yet. Sign in to ask the first one.