cockroachdb
Installation
SKILL.md
CockroachDB
CockroachDB is a cloud-native, distributed SQL database. It survives disk, machine, rack, and even datacenter failures with zero downtime. It speaks PostgreSQL.
When to Use
- Global Distributed SQL: Multi-region enterprise applications requiring PostgreSQL compatibility with multi-region write latency optimization.
- Zero-Downtime Surviving Outages: Applications requiring automated failover and self-healing data survival across region or datacenter outages.
- Strict Serializable ACID Transactions: Systems requiring the highest isolation level (Serializable) to prevent phantom reads and write skews.
- Horizontal Scaling without Sharding: Scaling relational databases beyond single-instance limits without manual application-layer sharding.
Quick Start
-- Create a table with UUID primary key for distributed scale
CREATE TABLE accounts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
balance DECIMAL(19,4)
);