{
  "id": "database_config",
  "title": "CRDB database config object",
  "url": "https://redis.io/docs/latest/operate/rs/8.0/references/rest-api/objects/crdb/database_config/",
  "summary": "An object that represents the database configuration",
  "content": "\nAn object that represents the database configuration. This configuration object is used in two contexts within CRDB objects:\n\n- As `default_db_config` in the main [CRDB object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/crdb) for settings that apply to all instances. In most cases, instances should use the same configuration.\n\n- As `db_config` in individual [instance objects](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/crdb/instance_info) to override `default_db_config` or add configuration values for specific instances. Use `db_config` only when an instance needs different settings than the default configuration.\n\n## `default_db_config` settings\n\n### Requires `default_db_config`\n\nUse `default_db_config` to set the following fields so they apply to every instance in the Active-Active database. Do not set these fields in `db_config` at the instance level because if they differ between instances, replication can fail to start, stop syncing, or return errors.\n\n| Name | Type/Value | Description |\n|------|------------|-------------|\n| module_list | array of module objects | List of modules to be loaded to all participating clusters of the Active-Active database\u003cbr /\u003e[{\u003cbr /\u003e  \"module_id\": string,\u003cbr /\u003e  \"module_args\": string,\u003cbr /\u003e  \"module_name\": string,\u003cbr /\u003e  \"semantic_version\": string,\u003cbr /\u003e}, ...]\u003cbr /\u003e**module_id**: Module UID (deprecated; use `module_name` instead)\u003cbr /\u003e**module_args**: Module command-line arguments (pattern does not allow special characters \u0026,\\\u003c,\u003e,\")\u003cbr /\u003e**module_name**: Module's name\u003cbr /\u003e**semantic_version**: Module's semantic version (deprecated; use `module_args` instead)\u003cbr /\u003e\u003cbr /\u003e**module_id** and **semantic_version** are optional as of Redis Software v7.4.2 and deprecated as of v7.8.2. |\n| oss_sharding | boolean (default: false) | An alternative to `shard_key_regex` for using the common case of the OSS shard hashing policy |\n| sharding | boolean (default:\u0026nbsp;false) | Cluster mode (server-side sharding). When true, shard hashing rules must be provided by either `oss_sharding` or `shard_key_regex` |\n| shard_key_regex | `[{ \"regex\": string }, ...]` | Custom keyname-based sharding rules (required if sharding is enabled)\u003cbr /\u003e\u003cbr /\u003eTo use the default rules you should set the value to:\u003cbr /\u003e`[{\"regex\": \".*\\\\{(?\u003ctag\u003e.*)\\\\}.*\"}, {\"regex\": \"(?\u003ctag\u003e.*)\"}]` |\n| tls_mode | 'enabled'\u003cbr /\u003e **'disabled'** \u003cbr /\u003e'replica_ssl' | Encrypt communication |\n\n### Important to use `default_db_config`\n\nThe following fields don't break replication if they differ between instances, but mismatches can cause problems over time, such as uneven load, higher latency, or inconsistent behavior across clusters. Set them in `default_db_config` so they apply to every instance in the Active-Active database.\n\n| Name | Type/Value | Description |\n|------|------------|-------------|\n| eviction_policy | **'noeviction'**\u003cbr /\u003e'allkeys-lru'\u003cbr /\u003e'allkeys-lfu'\u003cbr /\u003e'allkeys-random'\u003cbr /\u003e'volatile-lru'\u003cbr /\u003e'volatile-lfu'\u003cbr /\u003e'volatile-random'\u003cbr /\u003e'volatile-ttl' | Database memory eviction policy. See [eviction policy](https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy) for more information. |\n| memory_size | integer (default: 0) | Database memory size limit in bytes. 0 is unlimited. |\n| oss_cluster | boolean (default: false) | Enables OSS Cluster mode |\n| \u003cspan class=\"break-all\"\u003eoss_cluster_api_preferred_ip_type\u003c/span\u003e | 'internal'\u003cbr /\u003e'external' | Indicates preferred IP type in OSS cluster API |\n| proxy_policy | 'single'\u003cbr /\u003e'all-master-shards'\u003cbr /\u003e'all-nodes' | The policy used for proxy binding to the endpoint |\n| rack_aware | boolean (default: false) | Require the database to be always replicated across multiple racks |\n| shards_count | integer (range: 1-512) (default: 1) | Number of database shards |\n| shards_placement | 'dense'\u003cbr /\u003e'sparse' | Control the density of shards\u003cbr /\u003eValues:\u003cbr /\u003e**'dense'**: Shards reside on as few nodes as possible \u003cbr /\u003e **'sparse'**: Shards reside on as many nodes as possible |\n\n### Recommended `default_db_config`\n\nThe following fields don't break replication or cause future issues if they differ between instances. However, if there is no reason to use different values, you should use `default_db_config` to set them across all Active-Active database instances.\n\n| Name | Type/Value | Description |\n|------|------------|-------------|\n| aof_policy | **'appendfsync-every-sec'** \u003cbr /\u003e'appendfsync-always' | Policy for Append-Only File data persistence |\n| \u003cspan class=\"break-all\"\u003eauthentication_redis_pass\u003c/span\u003e | string | Redis AUTH password (deprecated as of Redis Software v7.2, replaced with multiple passwords feature in version 6.0.X) |\n| data_persistence | 'disabled'\u003cbr /\u003e'snapshot'\u003cbr /\u003e**'aof'** | Database on-disk persistence policy. For snapshot persistence, a [snapshot_policy](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/bdb/snapshot_policy) must be provided |\n| max_aof_file_size | integer | Maximum AOF file size in bytes |\n| max_aof_load_time | integer (default: 3600) | Maximum AOF reload time in seconds |\n| replication | boolean (default: true) | Database replication |\n| \u003cspan class=\"break-all\"\u003ereplication_oom_threshold_percent\u003c/span\u003e | integer (range: 0-20) (default: 5) | Reserved memory buffer percentage below `maxmemory` that blocks client writes while allowing Active-Active replication. Requires Redis database version 8.4 or later. See [Replication OOM protection](https://redis.io/docs/latest/operate/rs/databases/active-active/planning#replication-oom-protection) for more information. |\n| snapshot_policy | array of [snapshot_policy](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/bdb/snapshot_policy) objects | Policy for snapshot-based data persistence. A dataset snapshot will be taken every N secs if there are at least M writes changes in the dataset. |\n\n## Per-instance `db_config` settings\n\nSet the following fields in an individual [instance](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/crdb/instance_info)'s `db_config` because they are specific to that cluster's environment.\n\n| Name | Type/Value | Description |\n|------|------------|-------------|\n| \u003cspan class=\"break-all\"\u003eauthentication_admin_pass\u003c/span\u003e | string | Administrative databases access token |\n| \u003cspan class=\"break-all\"\u003eauthentication_ssl_client_certs\u003c/span\u003e | array | List of authorized client certificates. For Active-Active databases, it is strongly advised to configure the client certificates individually for each instance instead of using the default database configuration, even if the same certificate is used across all instances.\u003cbr /\u003e[{\u003cbr /\u003e  \"client_cert\": string\u003cbr /\u003e}, ...]\u003cbr /\u003e**client_cert**: X.509 PEM (Base64) encoded certificate |\n| cert | string | Optional PEM-encoded server certificate for the underlying database instance |\n| \u003cspan class=\"break-all\"\u003eenforce_client_authentication\u003c/span\u003e | **'enabled'** \u003cbr /\u003e'disabled' | Require authentication of client certificates for SSL connections to the database. If enabled, a certificate should be provided in either \u003cspan class=\"break-all\"\u003e`authentication_ssl_client_certs`\u003c/span\u003e or \u003cspan class=\"break-all\"\u003e`authentication_ssl_crdt_certs`\u003c/span\u003e |\n| \u003cspan class=\"break-all\"\u003emtls_allow_outdated_certs\u003c/span\u003e | boolean (default: false) | An optional mTLS relaxation flag for certs verification |\n| \u003cspan class=\"break-all\"\u003emtls_allow_weak_hashing\u003c/span\u003e | boolean (default: false) | An optional mTLS relaxation flag for certs verification |\n| port | integer | TCP port for database access |\n| private_key | string | Optional PEM-encoded private key matching the certificate for the underlying database instance |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-07-23T12:05:56-05:00"
}
