/

CockroachDB
CockroachDB plugin for Cursor — explore schemas, write optimized SQL, debug queries, and manage distributed database clusters directly from your AI coding agent.
Skills32
benchmarking-transaction-patternsGuides benchmarking and comparing explicit multi-statement transactions versus single-statement CTE transactions in CockroachDB, with fair test methodology, contention analysis, and performance interpretation. Use when comparing transaction formulations, benchmarking CockroachDB workloads under contention, investigating retry pressure, or deciding whether to rewrite multi-step application flows into single SQL statements.
designing-application-transactionsGuides application developers in designing correct and performant transaction patterns for CockroachDB, covering transaction lifetime, implicit vs explicit transactions, retry handling with exponential backoff, pushing invariants into SQL, selective pessimistic locking, set-based operations, connection pooling, prepared statements, keyset pagination, follower reads, and separating business logic from database logic. Use when building applications on CockroachDB, designing transaction workflows, handling retries, optimizing application-layer database interactions, or configuring connection pools.
designing-multi-region-applicationsGuides developers in selecting and implementing multi-region patterns for CockroachDB applications, covering active-passive vs active-active architectures, REGIONAL BY ROW, GLOBAL tables, manual geo-partitioning with lease preferences, and live demo setup with validation queries. Use when designing multi-region database topologies, choosing between REGIONAL BY ROW and manual partitioning, building multi-region demos, or optimizing cross-region latency.
analyzing-range-distributionAnalyzes CockroachDB range distribution across tables and indexes using SHOW RANGES to identify range count, size patterns, leaseholder placement, and replication health. Use when investigating hotspots, uneven data distribution, range fragmentation, or validating zone configuration effects without DB Console access.
analyzing-schema-change-storage-riskEstimates storage requirements for CockroachDB schema change backfills by analyzing per-index range sizes using SHOW RANGES WITH DETAILS and applying the 3× free space rule. Use when planning CREATE INDEX, ADD COLUMN, or ALTER PRIMARY KEY operations on large tables to avoid disk exhaustion during backfill.
Rules4
cockroachdb-app-patternsApplication-level best practices and anti-patterns when building applications on CockroachDB. Covers transaction retry logic, ORM configuration, schema design, connection management, online DDL, batching, session guardrails, and multi-region patterns. Based on real-world production patterns from cockroachdb-best-practices-demo and cockroachdb-jdbc-wrapper.
cockroachdb-developer-patternsAdvanced CockroachDB application development patterns for JPA/Hibernate, Spring, JavaEE, and set-based SQL. Covers JPA identity generators, Spring AOP transaction retry, JavaEE BMT/CMT retry interceptors, CTE-based set operations, Hibernate batch configuration, entity mapping optimization, and query parallelism for bulk operations. Complements cockroachdb-app-patterns (general retry/ORM/connection) with framework-specific depth.
cockroachdb-operator-patternsCockroachDB operations, SRE, and runbook patterns. Covers cluster maintenance procedures, monitoring and alerting, diagnostic queries, troubleshooting contention and hardware issues, emergency procedures, backup/restore, version upgrades, changefeed management, capacity planning, and query parallelism for bulk operations. Based on the official CockroachDB runbook template and production operational patterns.
cockroachdb-sql-patternsCockroachDB SQL best practices, anti-patterns, and distributed database patterns. These rules MUST be followed when writing SQL, schema definitions, or application code that interacts with CockroachDB. Covers 24 verified best practices from production workloads.