{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/bdbs/actions/revamp",
  "title": "Revamp database requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/revamp/",
  "summary": "REST API requests to update database configuration and optimize shard placement",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2025-05-19T15:06:21-05:00",
  "page_type": "content",
  "content_hash": "94635642024a8d23f921cf78de7911b06c661b0cb5ccc9b7bd5ce7718903058d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [PUT](#put-bdbs-actions-revamp) | `/v1/bdbs/{uid}/actions/revamp` | Update database configuration and optimize shard placement |"
    },
    {
      "id": "put-bdbs-actions-revamp",
      "title": "Revamp database",
      "role": "content",
      "text": "[code example]\n\nUpdates the topology-related configurations of an active database and optimizes the shard placement for the new configuration.\n\n#### Required permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [update_bdb_with_action](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_bdb_with_action) | admin<br />cluster_member<br />db_member |"
    },
    {
      "id": "put-request",
      "title": "Request",
      "role": "content",
      "text": "You can include the following parameters in the request JSON body to update their values:\n\n| Field | Type/Value | Description |\n|-------|------------|-------------|\n| avoid_nodes | array of strings | Cluster node UIDs to avoid when placing the database's shards and binding its endpoints. |\n| bigstore_ram_size | integer | Memory size of bigstore RAM part. |\n| memory_size | integer (default: 0) | Database memory limit in bytes. 0 is unlimited. |\n| replication | boolean | If `true`, enable in-memory database replication mode. |\n| shards_count | integer, (range: 1-512) (default: 1) | Number of database server-side shards. |\n| shards_placement | \"dense\"<br />\"sparse\" | Control the density of shards. Values:<br />**dense**: Shards reside on as few nodes as possible.<br />**sparse**: Shards reside on as many nodes as possible. |\n\n#### Example HTTP request\n\n[code example]\n\nDry-run example:\n\n[code example]\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the database to update. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| dry_run | boolean | If true, returns a blueprint of the database update without actually changing the database. Default is false. |\n| pause_persistence | boolean | If true, pause the persistence during the update. Default is false. |"
    },
    {
      "id": "put-response",
      "title": "Response",
      "role": "returns",
      "text": "- If `dry_run` is `false`, returns an `action_uid`. You can track the action's progress with a [`GET /v1/actions/<action_uid>`](https://redis.io/docs/latest/operate/rs/references/rest-api/requests/actions#get-action) request.\n\n- If `dry_run` is `true`, returns a blueprint of the database update.\n\n#### Example response\n\nIf `dry_run` is `false`:\n\n[code example]\n\nIf `dry_run` is `true`:\n\n[code example]\n\n#### Status codes {#put-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | When `dry_run` is false: The request is accepted and is being processed. The database state will be `active-change-pending` until the request has been fully processed. <br />When `dry_run` is true: No error. |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Attempting to perform an action on a nonexistent database. |\n| [406 Not Acceptable](https://www.rfc-editor.org/rfc/rfc9110.html#name-406-not-acceptable) | The requested configuration is invalid. |\n| [409 Conflict](https://www.rfc-editor.org/rfc/rfc9110.html#name-409-conflict) | Attempting to change a database while it is busy with another configuration change. In this context, this is a temporary condition and the request should be re-attempted later. |"
    }
  ],
  "examples": [
    {
      "id": "put-bdbs-actions-revamp-ex0",
      "language": "sh",
      "code": "PUT /v1/bdbs/{int: uid}/actions/revamp",
      "section_id": "put-bdbs-actions-revamp"
    },
    {
      "id": "put-request-ex0",
      "language": "sh",
      "code": "PUT /v1/bdbs/1/actions/revamp\n{\n    \"replication\": true,\n    \"shards_count\": 12\n}",
      "section_id": "put-request"
    },
    {
      "id": "put-request-ex1",
      "language": "sh",
      "code": "PUT /v1/bdbs/1/actions/revamp?dry_run=true\n{\n  \"replication\": true,\n  \"shards_count\": 12\n}",
      "section_id": "put-request"
    },
    {
      "id": "put-response-ex0",
      "language": "sh",
      "code": "{\n  \"action_uid\": \"21ad01d5-55aa-4ec6-b5c0-44dc95176486\"\n}",
      "section_id": "put-response"
    },
    {
      "id": "put-response-ex1",
      "language": "sh",
      "code": "[\n  {\n    \"nodes\": [\n      {\n        \"node_uid\": \"3\",\n        \"role\": \"master\"\n      },\n      {\n        \"node_uid\": \"1\",\n        \"role\": \"slave\"\n      }\n    ],\n    \"slot_range\": \"5461-10922\"\n  },\n  {\n    \"nodes\": [\n      {\n        \"node_uid\": \"3\",\n        \"role\": \"master\"\n      },\n      {\n        \"node_uid\": \"1\",\n        \"role\": \"slave\"\n      }\n    ],\n    \"slot_range\": \"10923-16383\"\n  },\n  {\n    \"nodes\": [\n      {\n        \"node_uid\": \"3\",\n        \"role\": \"master\"\n      },\n      {\n        \"node_uid\": \"1\",\n        \"role\": \"slave\"\n      }\n    ],\n    \"slot_range\": \"0-5460\"\n  }\n]",
      "section_id": "put-response"
    }
  ]
}
