{
  "id": "replication",
  "title": "Database replication",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/databases/durability-ha/replication/",
  "summary": "",
  "content": "Database replication helps ensure high availability.\nWhen replication is enabled, your dataset is replicated to a replica shard,\nwhich is constantly synchronized with the primary shard. If the primary \nshard fails, an automatic failover happens and the replica shard is promoted.  That is, it becomes the new primary shard. \n\nWhen the old primary shard recovers, it becomes\nthe replica shard of the new primary shard. This auto-failover mechanism\nguarantees that data is served with minimal interruption.\n\nYou can tune your high availability configuration with:\n\n- [Rack/Zone\nAwareness]() - When rack-zone awareness is used additional logic ensures that master and replica shards never share the same rack, thus ensuring availability even under loss of an entire rack.\n- [High Availability for Replica Shards]() - When high availability\nfor replica shards is used, the replica shard is automatically migrated on node failover to maintain high availability.\n\n\nEnabling replication has implications for the total database size,\nas explained in [Database memory limits]().\n\n\n## Auto Tiering replication considerations\n\nWe recommend that you set the sequential replication feature using\n`rladmin`. This is due to the potential for relatively slow replication\ntimes that can occur with Auto Tiering enabled databases. In some\ncases, if sequential replication is not set up, you may run out of memory. \n\nWhile it does not cause data loss on the\nprimary shards, the replication to replica shards may not succeed as long\nas there is high write-rate traffic on the primary and multiple\nreplications at the same time.\n\nThe following `rladmin` command sets the number of primary shards eligible to\nbe replicated from the same cluster node, as well as the number of replica\nshards on the same cluster node that can run the replication process at\nany given time.\n\nThe recommended sequential replication configuration is two, i.e.:\n\n```sh\nrladmin tune cluster max_redis_forks 1 max_slave_full_syncs 1\n```\n\n\nThis means that at any given time,\nonly one primary and one replica can be part of a full sync replication process.\n\n\n## Database replication backlog\n\nRedis databases that use [replication for high availability]() maintain a replication backlog (per shard) to synchronize the primary and replica shards of a database.\nBy default, the replication backlog is set to one percent (1%) of the database size divided by the database number of shards and ranges between 1MB to 250MB per shard.\nUse the [`rladmin`]() and the [`crdb-cli`]() utilities to control the size of the replication backlog. You can set it to `auto` or set a specific size.  \n\nThe syntax varies between regular and Active-Active databases. \n\nFor a regular Redis database:\n```text\nrladmin tune db \u003cdb:id | name\u003e repl_backlog \u003cBacklog size in MB | 'auto'\u003e\n```\n\nFor an Active-Active database:\n```text\ncrdb-cli crdb update --crdb-guid \u003ccrdb_guid\u003e --default-db-config \"{\\\"repl_backlog_size\\\": \u003csize in MB | 'auto'\u003e}\"\n```\n\n### Active-Active replication backlog\n\nIn addition to the database replication backlog, Active-Active databases maintain a backlog (per shard) to synchronize the database instances between clusters.\nBy default, the Active-Active replication backlog is set to one percent (1%) of the database size divided by the database number of shards, and ranges between 1MB to 250MB per shard.\nUse the [`crdb-cli`]() utility to control the size of the CRDT replication backlog. You can set it to `auto` or set a specific size:  \n\n```text\ncrdb-cli crdb update --crdb-guid \u003ccrdb_guid\u003e --default-db-config \"{\\\"crdt_repl_backlog_size\\\": \u003csize in MB | 'auto'\u003e}\"\n```\n\n**For Redis Software versions earlier than 6.0.20:**\nThe replication backlog and the CRDT replication backlog defaults are set to 1MB and cannot be set dynamically with 'auto' mode.\nTo control the size of the replication log, use [`rladmin`]() to tune the local database instance in each cluster.\n```text\nrladmin tune db \u003cdb:id | name\u003e repl_backlog \u003cBacklog size in MB (or if ending with bytes, KB or GB, in the respective unit)\u003e\n```\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

