/scylladb:scylladb-data-modelingfrom scylladb
Guides ScyllaDB CQL data modeling: primary key design, compaction strategies, TTL, tombstone management, and lightweight transactions. Use when designing schemas, migrating from SQL/MongoDB, or troubleshooting performance from bad data models.
Ships in scylladb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
If the task goes beyond this skill, use the parent scylladb skill for a ScyllaDB overview and the list of other ScyllaDB skills. If it is not installed, fetch it from https://raw.githubusercontent.com/scylladb/agent-skills/main/skills/scylladb/SKILL.md.
CQL data modeling patterns and anti-patterns for ScyllaDB. Bad schema is the root cause of most ScyllaDB performance issues — no amount of cluster scaling can fix a fundamentally wrong data model.
ALLOW FILTERING in queries or code reviewsIF NOT EXISTS, IF EXISTS, IF <condition>) or choosing serial consistencyFor adjacent topics, use the sibling skill instead:
scylladb-cloud-setupscylladb-vector-searchscylladb-alternator. The partition-key rules in this skill still apply to them.scylladb-kubernetes"Start from the queries, not from the entities."
This is ScyllaDB's core data modeling philosophy. Unlike relational databases where you normalize entities and then write queries against them, in ScyllaDB you:
SELECT, UPDATE, and DELETE your application will runIn ScyllaDB, the partition key determines which node holds the data and the clustering columns determine the sort order within that partition. The primary key IS your access pattern.
PRIMARY KEY ((partition_key_col1, partition_key_col2), clustering_col1, clustering_col2)
|___________________________________| |__________________________________|
Partition key Clustering columns
(determines node/shard) (determines sort order within
the partition)
WHERE clause — queries that don't specify the full partition key require ALLOW FILTERING (a full-scan) or a secondary indexASC by default, configurable with WITH CLUSTERING ORDER BY| Concept | SQL | MongoDB | ScyllaDB |
|---|---|---|---|
| Schema design | Entity-first (normalize) | Document-first (embed) | Query-first (denormalize per query) |
| Data unit | Row in a table | Document in a collection | Row in a partition |
| Joins | JOIN clause | $lookup aggregation | Not supported — denormalize instead |
| Aggregates | Any column, any GROUP BY | Aggregation pipeline | COUNT, SUM, AVG, MIN, MAX; GROUP BY only on a primary key prefix |
| Flexible schema | No (strict DDL) | Yes (schema-optional) | No (strict CQL DDL) |
| Index required for queries | Often optional | Recommended | Partition key required in every query |
| Unique constraint | UNIQUE | unique: true index | Primary key only. INSERT ... IF NOT EXISTS (LWT) rejects duplicates; for a non-key column, insert into a lookup table keyed on it |
| Transactions | Full ACID | Multi-document ACID | Lightweight Transactions (LWT) for single-partition linearizable ops |
As of ScyllaDB 2025.4, WITH replication is optional. Use the simple form by default:
CREATE KEYSPACE myapp;
Explicitly specifying NetworkTopologyStrategy and replication_factor remains valid but is not required.
Never use SimpleStrategy. Tablets support only NetworkTopologyStrategy, and many Cassandra tutorials still show SimpleStrategy.
New keyspaces use tablets by default (controlled by tablets_mode_for_new_keyspaces). Check the ScyllaDB version before using these features in a tablets keyspace:
CREATE KEYSPACE myapp_counters
WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}
AND tablets = {'enabled': false};
Each reference explains why the rule matters, shows incorrect and correct CQL, and lists when the rule does not apply.
ALLOW FILTERING forces a full-scan. Consult this reference whenever you see it in a query, or when a query does not include the full partition key.WITH CLUSTERING ORDER BY.CREATE INDEX or CREATE MATERIALIZED VIEW.IF clause, when choosing SERIAL or LOCAL_SERIAL, when a conditional write times out, or when porting Cassandra LWT code that reads the result set.compaction = {...} clause, or when disk usage or write amplification is high.default_time_to_live, per-row TTL (ScyllaDB 2026.2+), and how expired data leaves the disk. Consult when data has a retention period, when using USING TTL, or when rows expire only partially.tombstone_gc modes and their defaults, ScyllaDB's empty-page behavior, and the queue anti-pattern. Consult when designing deletes, when reads slow down after deletes, when pages come back empty, or before changing gc_grace_seconds.references/antipattern-allow-filtering.md (opens in a new tab)references/antipattern-hot-partitions.md (opens in a new tab)references/antipattern-large-partitions.md (opens in a new tab)references/antipattern-multi-partition-batch.md (opens in a new tab)references/antipattern-unpaged-queries.md (opens in a new tab)references/clustering-columns.md (opens in a new tab)references/compaction-strategies.md (opens in a new tab)references/lwt.md (opens in a new tab)references/partition-key-design.md (opens in a new tab)references/pattern-bucketing.md (opens in a new tab)references/query-first-design.md (opens in a new tab)references/secondary-indexes-and-mv.md (opens in a new tab)references/tombstones.md (opens in a new tab)references/ttl.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
scylladb, cql, data-modeling, schema-design, tombstones, compaction-strategy
Other plugins' skills for the same job
npx claudepluginhub scylladb/agent-skills --plugin scylladb8 skills in this plugin
/scylladbOverview of ScyllaDB and a map of the ScyllaDB agent skills, with instructions to install or fetch a skill that is missing. Use this skill when starting a project on ScyllaDB or moving an existing project to ScyllaDB, when a task covers more than one ScyllaDB area, or when no more specific ScyllaDB skill matches. Child skill scylladb-data-modeling wins for CQL schemas, keys, indexes, TTL, and compaction. Child skill scylladb-cloud-setup wins for connections, drivers, and credentials. Child skill scylladb-java-driver-migration wins for moving Java driver 3.x code to 4.x. Also use to find the skill for vector, full-text, and hybrid search, the DynamoDB API (Alternator), Kubernetes and the ScyllaDB Operator, the ScyllaDB Cloud MCP server, or benchmarks and load tests of ScyllaDB Cloud. Triggers on "ScyllaDB", "Scylla", "ScyllaDB Cloud", "get started with ScyllaDB", "use ScyllaDB", "migrate to ScyllaDB", "switch to ScyllaDB"./scylladb-alternatorGuide users building against ScyllaDB's DynamoDB-compatible API (Alternator). Use this skill when a user is porting a DynamoDB application to ScyllaDB, using boto3/AWS SDK clients against ScyllaDB, or asking about Alternator setup, write isolation, or load balancing. CQL schema design goes to scylladb-data-modeling. Triggers on "Alternator", "DynamoDB API", "DynamoDB compatible", "boto3 with ScyllaDB", "migrate from DynamoDB", "aws-sdk against ScyllaDB", "alternator_port", "alternator_write_isolation"./scylladb-benchmarkRun a repeatable load test of a ScyllaDB Cloud cluster on AWS with cassandra-stress, from loader VMs in a peered VPC, and write a report with a fixed results table. The default fast path measures the maximum 50/50 read/write rate at p99 ≤ 10 ms on a pinned X Cloud cluster; a user profile tests the schema and queries of the user's application. Use this skill when a user asks to benchmark, load test, or stress test ScyllaDB Cloud, to measure p50, p90, and p99 latency at a target rate, to find the maximum throughput under a latency SLA, or to check if a cluster size is enough. It does not benchmark other databases; for a comparison it gives advice only. App connections go to scylladb-cloud-setup, and schema design goes to scylladb-data-modeling. Triggers on "benchmark ScyllaDB", "load test my cluster", "stress test", "cassandra-stress", "user profile", "ops/s", "max throughput", "p99 latency", "latency SLA", "read/write ratio", "loader", "benchmark report", "benchmark comparison"./scylladb-cloud-mcpHelp users set up and use the ScyllaDB Cloud MCP server to manage ScyllaDB Cloud clusters via AI agents. Use this skill when a user wants to manage ScyllaDB Cloud programmatically through an AI agent, configure the MCP server, create, delete, or monitor clusters via MCP, or integrate ScyllaDB Cloud management into an agentic workflow. Connecting an application to a cluster goes to scylladb-cloud-setup. Triggers on "ScyllaDB Cloud MCP", "MCP server ScyllaDB", "manage ScyllaDB with AI agent", "ScyllaDB MCP setup"./scylladb-cloud-setupGuide users through connecting to a ScyllaDB Cloud cluster, choosing the correct driver and version, and configuring authentication. Use this skill when a user needs to connect to ScyllaDB Cloud, pick a CQL driver, check a driver version, configure credentials, set the default consistency level, size the connection pool, or troubleshoot connection issues. Cluster management through an AI agent goes to scylladb-cloud-mcp. Triggers on "connect to ScyllaDB Cloud", "ScyllaDB connection", "ScyllaDB driver setup", "which driver", "driver version", "Java driver", "Python driver", "CQL connection", "DC-aware load balancing", "ScyllaDB credentials", "connection bundle", "shard-aware", "tablet-aware", "consistency level", "LOCAL_QUORUM", "too many connections"./scylladb-kubernetesGuide users deploying and operating ScyllaDB on Kubernetes via the official ScyllaDB Operator. Use this skill when a user is setting up a ScyllaCluster, configuring node storage/CPU pinning for ScyllaDB pods, installing the Operator, or troubleshooting a Kubernetes-based ScyllaDB deployment. Managed ScyllaDB Cloud clusters go to scylladb-cloud-setup. Triggers on "ScyllaDB Operator", "ScyllaCluster", "scylla-operator", "ScyllaDB on Kubernetes", "ScyllaDB Helm chart", "NodeConfig", "ScyllaDB EKS", "ScyllaDB GKE", "ScyllaDB OKE", "ScyllaDB kubernetes deployment", "exposeOptions", "ScyllaCluster TLS/mTLS", "ScyllaDB Manager backup/restore on Kubernetes", "multi-datacenter ScyllaDB", "externalSeeds".