# Configure namespace durability

This page describes Aerospike’s intracluster replication and cross cluster replication to protect data in case of server failure.

## Intracluster replication

In Aerospike, the [`replication-factor`](https://aerospike.com/docs/database/reference/config#namespace__replication-factor) configuration controls the number of copies of each record that reside in the cluster. Most servers have a `replication-factor` of 2, which ensures all data in the cluster can survive a single node failure. Replication does increase the total cost of a cluster. With a replication factor 2, the cluster requires twice the storage capacity of a cluster with a replication factor of 1. Replication also suffers a performance penalty, primarily due to the extra network latency incurred by synchronous replication.

::: note
Aerospike replicates synchronously on writes to ensure that all copies are consistent across the cluster, which can impact performance. See the [XDR documentation](https://aerospike.com/docs/database/8.1.0/learn/architecture/xdr) for instructions on asynchronous cross-datacenter replication.
:::

Configuring the replication factor is simple. The following example shows a replication factor of 2:

```plaintext
namespace NAMESPACE-NAME {

  ...

  replication-factor 2

  ...

}
```

## Cross-Datacenter Replication (XDR)

Aerospike Enterprise Edition includes the Cross-Datacenter Replication (XDR) feature to replicate data among clusters. For more information on XDR configuration, see the [configuration documentation](https://aerospike.com/docs/database/8.1.0/learn/architecture/xdr).

## Where to next?

-   Configure [Storage Engine](https://aerospike.com/docs/database/8.1.0/manage/namespace/storage/config) which determines if and where records are persisted.
-   Configure [Data Retention Policy](https://aerospike.com/docs/database/8.1.0/manage/namespace/retention), which determines how long records are kept.
-   Or return to [Configure Page](https://aerospike.com/docs/database/8.1.0/manage/database/as-config).