> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Resilience

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

CockroachDB provides built-in [**high availability (HA)**](#high-availability) features and [**disaster recovery (DR)**](#disaster-recovery) tooling to achieve operational resiliency in various deployment <InternalLink path="topology-patterns">topologies</InternalLink> and use cases.

* HA features ensure continuous access to data without interruption even in the presence of <InternalLink path="demo-cockroachdb-resilience">failures</InternalLink> or disruptions to maximize uptime.
* DR tools allow for recovery from major incidents to minimize downtime and data loss.

<img src="https://mintcdn.com/cockroachlabs/oogFxX5btwA131za/images/v25.3/resilience.svg?fit=max&auto=format&n=oogFxX5btwA131za&q=85&s=4de4af93d6f5f61fa26bd09bde89ac69" alt="Diagram showing how HA features and DR tools create a resilient CockroachDB deployment." style={{ width: "80%" }} width="624" height="248" data-path="images/v25.3/resilience.svg" />

You can balance required SLAs and recovery objectives with the cost and management of each of these features to build a resilient deployment.

* **Recovery Point Objective (RPO)**: The maximum amount of data loss (measured by time) that an organization can tolerate.
* **Recovery Time Objective (RTO)**: The maximum length of time it should take to restore normal operations following an outage.

<Tip>
  For a practical guide on how CockroachDB uses Raft to replicate, distribute, and rebalance data, refer to the <InternalLink path="demo-cockroachdb-resilience">CockroachDB Resilience demo</InternalLink>.
</Tip>

## High availability

* <InternalLink path="multi-active-availability">**Multi-active availability**</InternalLink>: CockroachDB's built-in <InternalLink path="architecture/replication-layer">Raft replication</InternalLink> stores data safely and consistently on multiple nodes to ensure no downtime even during a temporary node outage. <InternalLink path="configure-replication-zones">Replication controls</InternalLink> allow you to configure the number and location of <InternalLink path="architecture/glossary#replica">replicas</InternalLink> to suit a deployment.
  * For more detail on planning for single-region or multi-region recovery, refer to <InternalLink path="disaster-recovery-planning#single-region-survivability-planning">Single-region survivability planning</InternalLink> or <InternalLink path="disaster-recovery-planning#multi-region-survivability-planning">Multi-region survivability planning</InternalLink>.
* <InternalLink path="demo-cockroachdb-resilience">**Advanced fault tolerance**</InternalLink>: Capabilities built in to CockroachDB to perform routine maintenance operations with minimal impact to foreground performance. For example, <InternalLink path="online-schema-changes">online schema changes</InternalLink>, <InternalLink path="cockroach-start#write-ahead-log-wal-failover">write-ahead log failover</InternalLink>, and <InternalLink path="architecture/replication-layer#leader-leases">Leader leases</InternalLink>.
* <InternalLink path="logical-data-replication-overview">**Logical data replication (LDR)**</InternalLink> (Preview): A cross-cluster replication tool between active CockroachDB clusters, which supports a range of topologies. LDR provides eventually consistent, table-level replication between the clusters. Individually, each active cluster uses CockroachDB multi-active availability to achieve low, single-region write latency with transactionally consistent writes using Raft replication.

### Choose an HA strategy

|                                                | Single-region replication (synchronous)                                                     | Multi-region replication (synchronous)                                                                       | Logical data replication (asynchronous)                                                                                          |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| **RPO**                                        | 0 seconds                                                                                   | 0 seconds                                                                                                    | Immediate mode 0.5 seconds                                                                                                       |
| **RTO**                                        | Zero RTO Potential increased latency for 1-9 seconds                                        | Zero RTO Potential increased latency for 1-9 seconds                                                         | Zero RTO Application traffic failover time                                                                                       |
| **Write latency**                              | Region-local write latency p50 latency \< 5ms (for multiple availability zones in us-east1) | Cross-region write latency p50 latency > 50ms (for a multi-region cluster in us-east1, us-east-2, us-west-1) | Region-local latency depending on design p50 latency \< 5ms (for multiple availability zones in us-east1)                        |
| **Recovery**                                   | Automatic                                                                                   | Automatic                                                                                                    | Semi-automatic                                                                                                                   |
| **Fault tolerance**                            | Zero RPO node, availability zone failures within a cluster                                  | Zero RPO node, availability zone failures, region failures within a cluster                                  | Zero RPO node, availability zone within a cluster, region failures with loss up to RPO in a two-region (or two datacenter) setup |
| **Minimum regions to achieve fault tolerance** | 1                                                                                           | 3                                                                                                            | 2                                                                                                                                |

For details on designing your cluster topology for HA with replication, refer to the <InternalLink path="disaster-recovery-planning#hardware-failure">Disaster Recovery Planning</InternalLink> page.

## Disaster recovery

* <InternalLink path="take-backups-with-revision-history-and-restore-from-a-point-in-time">**Backup and point-in-time restore**</InternalLink>: Point-in-time backup and restore allows you to roll back to a specific point in time. Multiple supported <InternalLink path="use-cloud-storage">cloud storage</InternalLink> providers means that you can store backups in your chosen provider. <InternalLink path="take-full-and-incremental-backups">Incremental backups</InternalLink> allow you to configure backup frequency for lower <InternalLink path="disaster-recovery-overview">RPO</InternalLink>.
* <InternalLink path="physical-cluster-replication-overview">**Physical cluster replication (PCR)**</InternalLink>: A cross-cluster replication tool between an active primary CockroachDB cluster and a passive standby CockroachDB cluster. PCR provides transactionally consistent full-cluster replication.

### Choose a DR strategy

CockroachDB is designed to recover automatically; however, building backups or PCR into your DR plan protects against unforeseen incidents.

|                                                | Point-in-time backup & restore                               | Physical cluster replication (asynchronous)                                                                                      |
| ---------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| **RPO**                                        | >=5 minutes                                                  | 10s of seconds                                                                                                                   |
| **RTO**                                        | Minutes to hours, depending on data size and number of nodes | Seconds to minutes, depending on cluster size, and time of failover                                                              |
| **Write latency**                              | No impact                                                    | No impact                                                                                                                        |
| **Recovery**                                   | Manual restore                                               | Manual failover                                                                                                                  |
| **Fault tolerance**                            | Not applicable                                               | Zero RPO node, availability zone within a cluster, region failures with loss up to RPO in a two-region (or two-datacenter) setup |
| **Minimum regions to achieve fault tolerance** | 1                                                            | 2                                                                                                                                |

## See also

* <InternalLink path="architecture/overview">Architecture Overview</InternalLink>
* <InternalLink path="set-up-logical-data-replication">Set Up Logical Data Replication</InternalLink>
* <InternalLink path="set-up-physical-cluster-replication">Set Up Physical Cluster Replication</InternalLink>
* <InternalLink path="physical-cluster-replication-technical-overview">Physical Cluster Replication Technical Overview</InternalLink>
* <InternalLink path="backup-architecture">Backup Architecture</InternalLink>
* <InternalLink path="backup-and-restore-overview">Backup and Restore Overview</InternalLink>
* <InternalLink version="cockroachcloud" path="managed-backups">Managed Backups</InternalLink>
