Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 3.96 KB

topology-patterns.md

File metadata and controls

49 lines (35 loc) · 3.96 KB
title summary toc redirect_from key
Topology Patterns
Recommended topology patterns for running CockroachDB in a cloud environment.
true
cluster-topology-patterns.html
cluster-topology-patterns.html

This section provides recommended topology for running CockroachDB in a cloud environment, each with required configurations and latency and resiliency characteristics.

{{site.data.alerts.callout_info}} You can observe latency patterns for your cluster on the Network Latency page of the DB Console. {{site.data.alerts.end}}

Single-region patterns

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

Pattern Latency Resiliency Configuration
Development
  • Fast reads and writes
  • None
  • 1 node
  • No replication
Basic Production
  • Fast reads and writes
  • 1 AZ failure
  • 1 region
  • 3 AZs
  • 3+ nodes across AZs

Multi-region patterns

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.

{{site.data.alerts.callout_info}} The multi-region patterns described below are almost always table-specific. For example, you might use Regional Tables for frequently updated tables that are geographically specific, and Global Tables pattern for reference tables that are not tied to geography and that are read frequently but updated infrequently. {{site.data.alerts.end}}

| Pattern | Latency | Resiliency | |----------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------| | Regional Tables | Low latency for single-region writes and multi-region stale reads. | Depends on your survival goals. | | Global Tables | Low-latency multi-region reads; writes are higher latency than reads. | Depends on your survival goals. | | Follower Reads | Fast regional (historical) reads, slower cross-region writes. | Depends on your survival goals. | | Follow-the-Workload | Fast regional reads in the active region; slower cross-region reads elsewhere. Slower cross-region writes. | Depends on your survival goals. |

Anti-patterns

The following anti-patterns are ineffective or risky:

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