{
  "schema_version": 2,
  "id": "operate/rs/monitoring/db-availability",
  "title": "Check database availability for monitoring and load balancers",
  "url": "https://redis.io/docs/latest/operate/rs/8.0/monitoring/db-availability/",
  "summary": "Verify if a Redis Software database is available to perform read and write operations and can respond to queries from client applications.",
  "aliases": ["/operate/rs/databases/durability-ha/db-availability/"],
  "content": "\nYou can use the [database availability API](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/availability) to verify whether a Redis Software database is available to perform read and write operations and can respond to queries from client applications. Load balancers and automated monitoring tools can use this API to monitor database availability.\n\n\u003e [!NOTE]\n\u003e Database availability does not guarantee data availability.\n\n## Check database availability for monitoring\n\nTo monitor database availability, use the following REST API request:\n\n```sh\nGET /v1/bdbs/\u003cdatabase_id\u003e/availability\n```\n\nIf the OSS Cluster API is enabled, this request verifies all endpoints for this database are available. Otherwise, it verifies the database has at least one available endpoint.\n\nReturns the status code 200 OK if the database is available.\n\nIf the database is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/availability#get-db-error-codes).\n\n## Check local database endpoint availability for load balancers\n\nTo check database availability when using a load balancer and the recommended `all-nodes` proxy policy, use the local database endpoints for each node:\n\n```sh\nGET /v1/local/bdbs/\u003cdatabase_id\u003e/endpoint/availability\n```\n\nReturns HTTP status code 200 OK if all primary (master) shards are reachable from the local database endpoint.\n\nIf the local database endpoint is unavailable, returns an error status code and a JSON object that contains [`error_code` and `description` fields](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/availability#get-endpoint-error-codes).\n\n## Use lag-aware availability checks for disaster recovery {#lag-aware}\n\nThe database availability API supports lag-aware availability checks that consider replication lag tolerance. You can reduce the risk of data inconsistencies during disaster recovery by incorporating lag-aware availability checks into your disaster recovery solution and ensuring failover-failback flows only occur when databases are accessible and sufficiently synchronized.\n\n### Change default availability lag tolerance threshold\n\nThe lag tolerance threshold is 100 milliseconds by default. Depending on factors such as workload, network conditions, and throughput, you might want to adjust the lag tolerance threshold.\n\nTo change the default threshold for the entire cluster, set `availability_lag_tolerance_ms` with an [update cluster](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cluster#put-cluster) request:\n\n```sh\nPUT /v1/cluster\n{ \"availability_lag_tolerance_ms\": 100 }\n```\n\n### Lag-aware database availability checks\n\nTo perform a lag-aware database availability check using the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/bdbs/\u003cdatabase_id\u003e/availability?extend_check=lag\n```\n\nTo perform a lag-aware database availability check and override the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/bdbs/\u003cdatabase_id\u003e/availability?extend_check=lag\u0026availability_lag_tolerance_ms=100\n```\n\n### Lag-aware endpoint availability checks\n\nTo perform a lag-aware database endpoint availability check using the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/local/bdbs/\u003cdatabase_id\u003e/endpoint/availability?extend_check=lag\n```\n\nTo perform a lag-aware database endpoint availability check and override the cluster's default lag tolerance threshold:\n\n```sh\nGET /v1/local/bdbs/\u003cdatabase_id\u003e/endpoint/availability?extend_check=lag\u0026availability_lag_tolerance_ms=100\n```\n\n\n## Availability by database status\n\nThe following table shows the relationship between a database's status and availability. For more details about the database status values, see [BDB status field](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/bdb/status).\n\n| Database status | Availability |\n|-----------------|--------------|\n| active          | \u003cspan title=\"Available\"\u003e\u0026#x2705;\u003c/span\u003e Available |\n| active-change-pending | \u003cspan title=\"Available\"\u003e\u0026#x2705;\u003c/span\u003e Available |\n| creation-failed | \u003cspan title=\"Not available\"\u003e:x:\u003c/span\u003e Not available |\n| delete-pending  | \u003cspan title=\"Availability not guaranteed\" class=\"font-serif\"\u003e:warning:\u003c/span\u003e Availability not guaranteed |\n| import-pending  | \u003cspan title=\"Available\"\u003e\u0026#x2705;\u003c/span\u003e Available |\n| pending         | \u003cspan title=\"Available\"\u003e\u0026#x2705;\u003c/span\u003e Available |\n| recovery        | \u003cspan title=\"Not available\"\u003e:x:\u003c/span\u003e Not available |\n\n## Known issues\n\n- RS155734: Endpoint availability metrics do not work as expected due to a calculation error.\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-10-21T09:46:20-07:00"
}
