{
  "schema_version": 2,
  "id": "commands/arring",
  "title": "ARRING",
  "url": "https://redis.io/docs/latest/commands/arring/",
  "summary": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed.",
  "since": "8.8.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-24T11:07:00+02:00",
  "page_type": "content",
  "content_hash": "597eed77e04590bee3c65d7295802433bbbe19262d47aebfc9d5959fff39aa4e",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Inserts values into a ring buffer of specified size, wrapping and truncating as needed."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the array.\n\n</details>\n\n<details open><summary><code>size</code></summary>\n\nThe size of the ring buffer window. Each value is inserted at `insert_idx % size`, wrapping back to index `0` when the end of the window is reached. When the buffer is full, newer values overwrite older ones. If `size` is smaller than the current window, the array is truncated to fit.\n\n</details>\n\n<details open><summary><code>value</code></summary>\n\nOne or more string values to insert into the ring buffer. Each value is placed at the next position in the ring and the cursor advances accordingly.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> ARRING readings 3 \"v0\"\n(integer) 0\nredis> ARRING readings 3 \"v1\"\n(integer) 1\nredis> ARRING readings 3 \"v2\"\n(integer) 2\nredis> ARRING readings 3 \"v3\"\n(integer) 0\nredis> ARGET readings 0\n\"v3\"\nredis> ARCOUNT readings\n(integer) 3\nredis> ARLASTITEMS readings 3\n1) \"v1\"\n2) \"v2\"\n3) \"v3\""
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): The last index where a value was inserted."
    }
  ],
  "examples": []
}
