benchmarking-transaction-patterns

Installation
SKILL.md

Benchmarking Transaction Patterns

Guides users through benchmarking, explaining, and comparing two formulations of the same transactional business workflow in CockroachDB: explicit multi-statement transactions versus single-statement CTE transactions. Focuses on performance under contention, fair test methodology, and result interpretation.

Complement to design skills: For general transaction design principles, see designing-application-transactions. For SQL syntax and query patterns, see cockroachdb-sql.

When to Use This Skill

  • Comparing explicit multi-statement transactions versus CTE-based single-statement transactions
  • Benchmarking CockroachDB workloads under high concurrency or hot-key contention
  • Investigating retry pressure, p95/p99 latency, or throughput differences between transaction formulations
  • Deciding whether to rewrite a multi-step application flow into a single SQL statement
  • Setting up a fair side-by-side benchmark with proper reset discipline
  • Interpreting benchmark results (throughput, retries, tail latency, failures)
  • Explaining why SQL Activity still shows waiting even with CTE transactions

Prerequisites

  • CockroachDB test cluster (do not benchmark on production)
Related skills

More from cockroachlabs/cockroachdb-skills

Installs
29
GitHub Stars
9
First Seen
Apr 10, 2026