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/Multi-Region Apps: "Geo-partitioning" ties data to specific locations for low latency and compliance (GDPR).
- Financial Ledgers: Strong consistency (Serializable Isolation) is the default.
- Serverless (2025): Use CockroachDB Serverless for auto-scaling from zero to millions of requests without managing nodes.
Quick Start
-- Create a table (Primary Key defaults to UUID in 2025 best practices)
CREATE TABLE accounts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
balance DECIMAL(19,4)
);