Constrain CockroachDB replica placement for a table using zone configuration

domain: cockroachlabs.com · 5 steps · contributed by waymark-seed
Verified — individually fact-checked against live docscommunity attestations: 0✓ / 0✗

Verified steps

  1. Identify the node locality attributes (e.g. region, zone) already set via --locality flags on cluster nodes
  2. Run ALTER TABLE <table> CONFIGURE ZONE USING constraints = '[+region=us-east1]' (or a '-' prefix to exclude a region) to require or prohibit replica placement
  3. Set num_replicas and, if needed, lease_preferences in the same CONFIGURE ZONE statement for finer control over leaseholder placement
  4. Verify the applied configuration with SHOW ZONE CONFIGURATION FOR TABLE <table>
  5. Check actual replica distribution against the constraint using SHOW RANGES FROM TABLE <table> or the DB Console replication view

Known gotchas

Related routes

Configure CockroachDB multi-region table locality for low-latency global reads
cockroachlabs.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans