yugabyte/yugabytedb-skills/ycql
Claude Code and agent skill by yugabyte/yugabytedb-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when writing or reviewing CQL code, schema definitions, or application code that targets YugabyteDB's Cassandra-compatible YCQL API (port 9042). Triggers on YCQL tables, partition keys, TTL, batching, or any mention of YugabyteDB with Cassandra/CQL.
Install
npx vskill@latest install yugabyte/yugabytedb-skills/ycqlSKILL.md
YugabyteDB YCQL Best Practices
YCQL is YugabyteDB's Cassandra-compatible API (port 9042). It provides global secondary indexes with strong consistency (ACID) — a key advantage over Apache Cassandra.
Schema Design
Partition Keys and Clustering Columns
Design partition keys for even data distribution and clustering columns for efficient range scans within a partition:
- Partition key (
customer_id): Determines tablet placement. Choose for even distribution. - Clustering columns (
order_date,order_id): Determine sort order within a partition.
Global Secondary Indexes
YCQL secondary indexes in YugabyteDB are global and strongly consistent (ACID), unlike Cassandra's local indexes:
Covering Indexes
Use the INCLUDE clause to serve queries directly from the index without a table lookup:
Unique Indexes
Data Types
- JSONB: Supported for schema-less data, but use only for truly dynamic values. Regular columns outperform JSONB for frequent access patterns.
- Counter increments: YugabyteDB supports integer increment/decrement with CAS operations in a single Raft round-trip (vs 4 in Apache Cassandra).
- Collections: Design for small datasets. Large collections significantly impact performance.
Size Limits
- Columns: Keep in the 2 MB range or less
- Rows: Keep in the 32 MB range or less
TTL (Time-to-Live)
Automatic data expiration at table, row, or column level:
Note: TTL is not supported for transactional tables.
Consistency Levels
YugabyteDB YCQL supports only two consistency levels: QUORUM (default) and ONE. Writes are always strongly consistent (QUORUM). Use ONE for follower reads (stale, lower-latency reads from nearest replica).
Lightweight Transactions (Atomic Read-Modify-Write)
IF EXISTS / IF NOT EXISTS operations are much faster than in Apache Cassandra — 1 Raft round-trip vs 4 LWT round-trips:
Query Optimization
Prepared Statements (Always Use)
Prepared statements enable partition-aware routing — the driver calculates the partition hash and sends the query directly to the correct tablet leader:
Batching
Batch operations send all operations in a single RPC call:
Use batching to group operations that target the same partition for best performance.
Connection Pooling
Use a single cluster object to manage connections. Typically 1–2 connections per YB-TServer is sufficient for 64–128 threads. The driver handles token-aware routing automatically when using prepared statements.
Retry Policy
Default retry policy retries once on certain failures. For write-heavy workloads, configure a custom retry policy with backoff to handle transient tablet leader changes during load balancing.
Large Table Operations
Use partition_hash to parallelize scans across tablets:
TRUNCATE vs DELETE
TRUNCATE is much faster than DELETE. DELETE inserts markers (tombstones) that require compaction. Use TRUNCATE for full-table cleanup.
Memory Configuration
For YCQL-only deployments, set --use_memory_defaults_optimized_for_ysql=false on yb-master to avoid reserving memory for the PostgreSQL layer.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ycql/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 7
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yugabyte/yugabytedb-skills/ycql)