Topology Patterns Overview

On this page Carat arrow pointing down
Warning:
As of November 18, 2022, CockroachDB v21.1 is no longer supported. For more details, refer to the Release Support Policy.

This section provides recommended patterns for running CockroachDB in a cloud environment.

Note:

You can observe latency for your cluster on the Network Latency page of the DB Console.

Single-region

When your clients are in a single geographic region, choosing a pattern is straightforward.

Deployment Type Latency Resiliency Configuration
Development
  • Fast reads and writes
  • None
  • 1 node
  • No replication
Basic Production
  • Fast reads and writes
  • 1 zone failure
  • 1 region
  • 3 zones
  • 3+ nodes across zones

Multi-region

When your clients are in multiple geographic regions, it is important to deploy your cluster across regions properly and then carefully choose:

  1. The right survival goal for each database.
  2. The right table locality for each of your tables.

Not doing so can result in unexpected latency and resiliency. For more information, see the Multi-Region Capabilities Overview.

Note:

The multi-region patterns described below are almost always table-specific. For example, you might use Regional Tables for frequently updated tables that are tied to a specific region, and Global Tables for reference tables that are not tied to a specific region, and that are read frequently but updated infrequently.

Pattern Latency
Regional Tables Low latency for single-region writes and multi-region stale reads.
Global Tables Low-latency multi-region reads from all regions, at the expense of higher latency cross-region writes.
Follower Reads Fast regional (historical) reads, slower cross-region writes.
Follow-the-Workload Fast regional reads in the active region; slower cross-region reads elsewhere. Slower cross-region writes.
Note:

In multi-region databases, the resiliency of each database depends on its survival goal settings.

Anti-patterns

The following anti-patterns are ineffective or risky:

  • Single-region deployments using 2 zones, or multi-region deployments using 2 regions. In these cases, the cluster would be unable to survive the loss of a single zone or a single region, respectively.
  • Broadly distributed multi-region deployments (e.g., us-west, asia, and europe) using only the default Follow-the-Workload behavior. In this case, latency will likely be unacceptably high.

See also


Yes No
On this page

Yes No