Considerations for planning Active-Active databases

Information about Active-Active database to take into consideration while planning a deployment, such as compatibility, limitations, and special configuration

Redis Software

In Redis Software, Active-Active geo-distribution is based on conflict-free replicated data type (CRDT) technology. Compared to databases without geo-distribution, Active-Active databases have more complex replication and networking, as well as a different data type.

Because of the complexities of Active-Active databases, there are special considerations to keep in mind while planning your Active-Active database.

See Active-Active Redis for more information about geo-distributed replication. For more info on other high availability features, see Durability and high availability.

Participating clusters

You need at least two participating clusters for an Active-Active database. If your database requires more than ten participating clusters, contact Redis support. You can add or remove participating clusters after database creation.

Note:
If an Active-Active database runs on flash memory, you cannot add participating clusters that run on RAM only.

For Redis Software versions earlier than 8.0.16, changes made from the Cluster Manager UI to an Active-Active database configuration only apply to the cluster you are editing. For global configuration changes across all clusters, use the crdb-cli command-line utility. As of Redis Software version 8.0.16, the Cluster Manager UI supports both global and local configuration changes for Active-Active databases.

Memory limits

Database memory limits define the maximum size of your database across all database replicas and shards on the cluster. Your memory limit also determines the number of shards.

Besides your dataset, the memory limit must also account for replication, Active-Active metadata, and module overhead. These features can increase your database size, sometimes increasing it by two times or more.

Factors to consider when sizing your database:

  • dataset size: you want your limit to be above your dataset size to leave room for overhead.
  • database throughput: high throughput needs more shards, leading to a higher memory limit.
  • modules: using modules with your database can consume more memory.
  • database clustering: enables you to spread your data into shards across multiple nodes (scale out).
  • database replication: enabling replication doubles memory consumption
  • Active-Active replication: enabling Active-Active replication requires double the memory of regular replication, which can be up to two times (2x) the original data size per instance.
  • database replication backlog for synchronization between shards. By default, this is set to 1% of the database size.
  • Active-Active replication backlog for synchronization between clusters. By default, this is set to 1% of the database size.

It's also important to know Active-Active databases have a lower threshold for activating the eviction policy, because it requires propagation to all participating clusters. The eviction policy starts to evict keys when one of the Active-Active instances reaches 80% of its memory limit.

For more information on memory limits, see Memory and performance or Database memory limits.

Replication OOM protection

When a shard in an Active-Active database reaches an out-of-memory (OOM) condition:

  1. Replication between that shard and its peers stops immediately.

  2. The syncer process sends commands to the affected shard to trigger garbage collection and free memory.

If the database has no eviction policy and no keys with expiration times (TTL), no memory can be freed, which can lead to persistent replication failure and data desynchronization.

To reduce this risk, Active-Active databases running Redis version 8.4 or later support a configurable memory buffer through the replication_oom_threshold_percent setting. This setting reserves a percentage of memory below maxmemory for internal replication operations.

The replication_oom_threshold_percent setting works as follows:

  • If memory usage is below the threshold, all client writes proceed normally.

  • If memory usage exceeds the threshold, Redis blocks external client write commands with an out-of-memory error, but internal replication and garbage collection continue in the reserved buffer.

  • If memory reaches maxmemory despite the client block, the standard out-of-memory behavior applies to all operations, including replication.

replication_oom_threshold_percent defaults to 5, which means 5% of maxmemory is reserved. To adjust the reserved percentage, use an update database configuration REST API request:

PUT https://<host>:<port>/v1/bdbs/<database_id>
{ "replication_oom_threshold_percent": <integer from 0 to 20> }

Networking

Network requirements for Active-Active databases include:

  • A VPN between each network that hosts a cluster with an instance (if your database spans WAN).
  • A network connection to several ports on each cluster from all nodes in all participating clusters.
  • A network time service running on each node in all clusters.

Networking between the clusters must be configured before creating an Active-Active database. The setup will fail if there is no connectivity between the clusters.

Network ports

Every node must have access to the REST API ports of every other node as well as other ports for proxies, VPNs, and the Cluster Manager UI. See Network port configurations for more details. These ports should be allowed through firewalls that may be positioned between the clusters.

Network Time Service

Active-Active databases require a time service like NTP or Chrony to make sure the clocks on all cluster nodes are synchronized. This is critical to avoid problems with internal cluster communications that can impact your data integrity.

See Synchronizing cluster node clocks for more information.

Redis modules

Several Redis modules are compatible with Active-Active databases. Find the list of compatible Redis modules.

Active-Active databases created with or upgraded to Redis version 8 or later automatically enable search and query and JSON, which allows you to index, query, and perform full-text searches of nested JSON documents.

Limitations

Active-Active databases have the following limitations:

  • An existing database can't be changed into an Active-Active database. To move data from an existing database to an Active-Active database, you must create a new Active-Active database and migrate the data.
  • Discovery service is not supported with Active-Active databases. Active-Active databases require FQDNs or mDNS.
  • The FLUSH command is not supported from the CLI. To flush your database, use the API or Cluster Manager UI.
  • The UNLINK command is a blocking command for all types of keys.
  • Cross slot multi commands (such as MSET) are not supported with Active-Active databases.
  • The hashing policy can't be changed after database creation.
  • Database clustering cannot be enabled or turned off after database creation.
  • Active-Active databases cannot be configured as Redis Flex deployments.
  • Active-Active databases handle replication internally and do not support the redis.set_repl() function in Lua scripts.
  • If you enabled the default database password during the creation of an Active-Active database, you should not turn off the default database password because it could prevent the removal of participating database instances.
  • When upgrading an Active-Active database from Redis 7.4 or earlier to version 8.0 or later, you cannot use module commands, such as Redis Search and JSON commands, until all Active-Active database instances in all participating clusters have been upgraded. These commands are not blocked automatically, and running these commands before finishing the upgrade process can cause syncer crashes.
RATE THIS PAGE
Back to top ↑