From a07a654b872102a384c9ac923110d4c170d54458 Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Mon, 16 Jun 2025 13:15:06 -0700 Subject: [PATCH 01/12] Add doc for used_memory_peak_time per yzc-yzc --- content/commands/info.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/commands/info.md b/content/commands/info.md index db7daa7809..548105590a 100644 --- a/content/commands/info.md +++ b/content/commands/info.md @@ -152,6 +152,7 @@ Here is the meaning of all fields in the **memory** section: * `used_memory_rss_human`: Human readable representation of previous value * `used_memory_peak`: Peak memory consumed by Redis (in bytes) * `used_memory_peak_human`: Human readable representation of previous value +* `used_memory_peak_time`: Time when peak memory was recorded * `used_memory_peak_perc`: The percentage of `used_memory` out of `used_memory_peak` * `used_memory_overhead`: The sum in bytes of all overheads that the server allocated for managing its internal data structures From 4db81aa3a456f3e6601a327f72a644c8ba005692 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Thu, 26 Jun 2025 09:10:38 -0700 Subject: [PATCH 02/12] DOC-5368: update VSIM command page for ROS8.2 (#1765) * DOC-5368: update VSIM command page for ROS8.2 * Apply review comments. Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> --------- Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> --- content/commands/vsim.md | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/content/commands/vsim.md b/content/commands/vsim.md index 90326672a1..9853b5c93c 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -13,10 +13,13 @@ complexity: O(log(N)) where N is the number of elements in the vector set. description: Return elements by vector similarity. group: vector_set hidden: false +history: +- - 8.2.0 + - added the WITHATTRIBS option. linkTitle: VSIM since: 8.0.0 summary: Return elements by vector similarity. -syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num] [EF search-exploration-factor]\n [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]" +syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]" title: VSIM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. --- @@ -39,16 +42,19 @@ VSIM word_embeddings ELE apple 10) "grape" ``` -You can include similarity scores and limit the number of results: +You can include similarity scores, attributes (if any), and limit the number of results: ```shell -VSIM word_embeddings ELE apple WITHSCORES COUNT 3 +VSIM word_embeddings ELE apple WITHSCORES WITHATTRIBS COUNT 3 1) "apple" 2) "0.9998867657923256" -3) "apples" -4) "0.8598527610301971" -5) "pear" -6) "0.8226882219314575" +3) "{\"len\": 5}" +4) "apples" +5) "0.859852746129036" +6) "{\"len\": 6}" +7) "pear" +8) "0.8226882070302963" +9) "{\"len\": 4}" ``` Set the `EF` (exploration factor) to improve recall at the cost of performance. Use the `TRUTH` option to perform an exact linear scan, useful for benchmarking. The `NOTHREAD` option runs the search in the main thread and may increase server latency. @@ -81,6 +87,12 @@ is either the vector data (for `FP32` or `VALUES`) or the name of the element (f returns the similarity score (from 1 to 0) alongside each result. A score of 1 is identical; 0 is the opposite. +
+WITHATTRIBS + +returns, for each element, the JSON attribute associated with the element or NULL when no attributes are present. +
+
COUNT num @@ -128,9 +140,11 @@ executes the search in the main thread instead of a background thread. Useful fo tab2="RESP3" >}} One of the following: -* [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for unknown element. -* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key. -* [Array reply](../../develop/reference/protocol-spec#arrays) with matching elements; juxtaposed with scores when used with the WITHSCORES option. +* [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for an unknown element. +* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for an unknown key. +* [Array reply](../../develop/reference/protocol-spec#arrays) with matching elements. +* With the `WITHSCORES` option, an [array reply](../../develop/reference/protocol-spec#arrays) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements juxtaposed with [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) as floating-point scores. +* With the `WITHSCORES` and `WITHATTRIBS` options, an [array reply](../../develop/reference/protocol-spec#arrays) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements, and two additional elements: (1) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) as floating-point score and (2) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) representing the JSON attribute associated with the element or [nil (null bulk string)]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) for the elements missing an attribute. -tab-sep- @@ -138,6 +152,7 @@ One of the following: * [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for unknown element. * [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key. * [Array reply](../../develop/reference/protocol-spec#arrays) with matching elements. -* [Map reply](../../develop/reference/protocol-spec#maps) with matching elements and [double](../../develop/reference/protocol-spec#doubles) scores when used with the WITHSCORES option. +* With the `WITHSCORES` option, a [map reply](../../develop/reference/protocol-spec#maps) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements (keys) and [double](../../develop/reference/protocol-spec#doubles) scores (values). +* With the `WITHSCORES` and `WITHATTRIBS` options, a [Map reply](../../develop/reference/protocol-spec#maps) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements (keys), and an additional array (values) with the following elements: (1) a [double reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) for the score and (2) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) representing the JSON attribute associated with the element or [null]({{< relref "/develop/reference/protocol-spec#nulls" >}}) for the elements missing an attribute. {{< /multitabs >}} From a0559a373cd0f28d807db712772313296b5033f6 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Thu, 26 Jun 2025 09:11:26 -0700 Subject: [PATCH 03/12] DOC-5367: update bitmap docs for ROS8.2 (#1759) * DOC-5367: update bitmap docs for ROS8.2 * Apply review comments. --- content/commands/bitop.md | 67 +++++++++++++++++++++++---- content/develop/data-types/bitmaps.md | 6 +-- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/content/commands/bitop.md b/content/commands/bitop.md index 6a18d136d7..7130568d49 100644 --- a/content/commands/bitop.md +++ b/content/commands/bitop.md @@ -21,6 +21,22 @@ arguments: name: not token: NOT type: pure-token + - display_text: diff + name: diff + token: DIFF + type: pure-token + - display_text: diff1 + name: diff1 + token: DIFF1 + type: pure-token + - display_text: andor + name: andor + token: ANDOR + type: pure-token + - display_text: one + name: one + token: ONE + type: pure-token name: operation type: oneof - display_text: destkey @@ -78,26 +94,45 @@ key_specs: linkTitle: BITOP since: 2.6.0 summary: Performs bitwise operations on multiple strings, and stores the result. -syntax_fmt: BITOP destkey key [key ...] +syntax_fmt: "BITOP destkey key [key ...]" syntax_str: destkey key [key ...] title: BITOP --- Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. -The `BITOP` command supports four bitwise operations: **AND**, **OR**, **XOR** -and **NOT**, thus the valid forms to call the command are: +The `BITOP` command supports eight bitwise operations: `AND`, `OR`, `XOR`, +`NOT`, `DIFF`, `DIFF1`, `ANDOR`, and `ONE`. The valid forms to call the command are: * `BITOP AND destkey srckey1 srckey2 srckey3 ... srckeyN` + + A bit in `destkey` is set only if it is set in all source bitmaps. * `BITOP OR destkey srckey1 srckey2 srckey3 ... srckeyN` + + A bit in `destkey` is set only if it is set in at least one source bitmap. * `BITOP XOR destkey srckey1 srckey2 srckey3 ... srckeyN` + + Mostly used with two source bitmaps, a bit in `destkey` is set only if its value differs between the two source bitmaps. * `BITOP NOT destkey srckey` -As you can see **NOT** is special as it only takes an input key, because it -performs inversion of bits so it only makes sense as a unary operator. + `NOT` is a unary operator and only supports a single source bitmap; set the bit to the inverse of its value in the source bitmap. +* `BITOP DIFF destkey X [Y1 Y2 ...]` [1](#list-note-1) + + A bit in `destkey` is set if it is set in `X`, but not in any of `Y1, Y2, ...` . +* `BITOP DIFF1 destkey X [Y1 Y2 ...]` [1](#list-note-1) -The result of the operation is always stored at `destkey`. + A bit in `destkey` is set if it is set in one or more of `Y1, Y2, ...`, but not in `X`. +* `BITOP ANDOR destkey X [Y1 Y2 ...]` [1](#list-note-1) + + A bit in `destkey` is set if it is set in `X` and also in one or more of `Y1, Y2, ...`. +* `BITOP ONE destkey X1 [X2 X3 ...]` [1](#list-note-1) + + A bit in `destkey` is set if it is set in exactly one of `X1, X2, ...`. + +The result of each operation is always stored at `destkey`. + +1. Added in Redis 8.2. ## Handling of strings with different lengths @@ -110,13 +145,27 @@ zero bytes up to the length of the longest string. ## Examples +1. Basic usage example using the `AND` operator: + {{% redis-cli %}} -SET key1 "foobar" -SET key2 "abcdef" +BITFIELD key1 SET i8 #0 255 +BITFIELD key2 SET i8 #0 85 BITOP AND dest key1 key2 -GET dest +BITFIELD dest GET i8 #0 {{% /redis-cli %}} +2. Suppose you want to expose people to a book-related ad. The target audience is people who love to read books and are interested in fantasy, adventure, or science fiction. Assume you have the following bitmaps: + +* `LRB` - people who love to read books. +* `B:F` - people interested in fantasy. +* `B:A` - people interested in adventure. +* `B:SF` - people interested in science fiction. + +To create a bitmap representing the target audience, use the following command: + +``` +BITOP ANDOR TA LRB B:F B:A B:SF +``` ## Pattern: real time metrics using bitmaps diff --git a/content/develop/data-types/bitmaps.md b/content/develop/data-types/bitmaps.md index ecfec177ac..1bbfa40f3c 100644 --- a/content/develop/data-types/bitmaps.md +++ b/content/develop/data-types/bitmaps.md @@ -9,9 +9,7 @@ categories: - oss - kubernetes - clients -description: 'Introduction to Redis bitmaps - - ' +description: Introduction to Redis bitmaps linkTitle: Bitmaps title: Redis bitmaps weight: 120 @@ -79,7 +77,7 @@ stored into the target key) are always considered to be zero. There are three commands operating on group of bits: -1. [`BITOP`]({{< relref "/commands/bitop" >}}) performs bit-wise operations between different strings. The provided operations are AND, OR, XOR and NOT. +1. [`BITOP`]({{< relref "/commands/bitop" >}}) performs bit-wise operations between different strings. The provided operators are `AND`, `OR`, `XOR`, `NOT`, `DIFF`, `DIFF1`, `ANDOR`, and `ONE`. 2. [`BITCOUNT`]({{< relref "/commands/bitcount" >}}) performs population counting, reporting the number of bits set to 1. 3. [`BITPOS`]({{< relref "/commands/bitpos" >}}) finds the first bit having the specified value of 0 or 1. From 62afd23cab5d72f53a8730c3f3e607b54be7d857 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Mon, 30 Jun 2025 06:29:45 -0700 Subject: [PATCH 04/12] DOC-5371: new CLUSTER SLOT-STATS command page for ROS8.2 (#1773) --- content/commands/cluster-slot-stats.md | 129 +++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 content/commands/cluster-slot-stats.md diff --git a/content/commands/cluster-slot-stats.md b/content/commands/cluster-slot-stats.md new file mode 100644 index 0000000000..973bfa53da --- /dev/null +++ b/content/commands/cluster-slot-stats.md @@ -0,0 +1,129 @@ +--- +arguments: +- arguments: + - arguments: + - name: start-slot + type: integer + - name: end-slot + type: integer + name: slotsrange + token: SLOTSRANGE + type: block + - arguments: + - name: metric + type: string + - name: limit + optional: true + token: LIMIT + type: integer + - arguments: + - name: asc + token: ASC + type: pure-token + - name: desc + token: DESC + type: pure-token + name: order + optional: true + type: oneof + name: orderby + token: ORDERBY + type: block + name: filter + type: oneof +arity: -4 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- STALE +- LOADING +command_tips: +- NONDETERMINISTIC_OUTPUT +- REQUEST_POLICY:ALL_SHARDS +complexity: O(N) where N is the total number of slots based on arguments. O(N*log(N)) + with ORDERBY subcommand. +container: CLUSTER +description: Return an array of slot usage statistics for slots assigned to the current + node. +function: clusterSlotStatsCommand +group: cluster +hidden: false +linkTitle: CLUSTER SLOT-STATS +reply_schema: + description: Array of nested arrays, where the inner array element represents a + slot and its respective usage statistics. + items: + description: Array of size 2, where 0th index represents (int) slot and 1st index + represents (map) usage statistics. + items: + - description: Slot Number. + type: integer + - additionalProperties: false + description: Map of slot usage statistics. + properties: + cpu-usec: + type: integer + key-count: + type: integer + network-bytes-in: + type: integer + network-bytes-out: + type: integer + type: object + maxItems: 2 + minItems: 2 + type: array + type: array +since: 8.2.0 +summary: Return an array of slot usage statistics for slots assigned to the current + node. +syntax_fmt: "CLUSTER SLOT-STATS " +syntax_str: '' +title: CLUSTER SLOT-STATS +--- + +Use this command to get an array of slot usage statistics for the slots assigned to the current shard. If you're working with a Redis cluster, this data helps you understand overall slot usage, spot hot or cold slots, plan slot migrations to balance load, or refine your application logic to better distribute keys. + +## Options + +`CLUSTER SLOT-STATS` has two mutually exclusive options: + +* `ORDERBY`: Sorts the slot statistics by the specified metric. Use ASC or DESC to sort in ascending or descending order. If multiple slots have the same value, the command uses the slot number as a tiebreaker, sorted in ascending order. + +* `SLOTSRANGE`: Limits the results to a specific, inclusive range of slots. Results are always sorted by slot number in ascending order. + +The command reports on the following statistics: + +* `KEY-COUNT`: Number of keys stored in the slot. +* `CPU-USEC`: CPU time (in microseconds) spent handling the slot. +* `NETWORK-BYTES-IN`: Total inbound network traffic (in bytes) received by the slot. +* `NETWORK-BYTES-OUT`: Total outbound network traffic (in bytes) sent from the slot. + +## Return information + +{{< multitabs id=“cmd-name-return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a nested list of slot usage statistics. +* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) otherwise. + +-tab-sep- + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a nested list of slot usage statistics. +* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) otherwise. + +{{< /multitabs >}} \ No newline at end of file From ff2830613ada5d12c151cf56d933be50a2d4da94 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Tue, 1 Jul 2025 10:28:48 -0700 Subject: [PATCH 05/12] DOC-5412: update KSN page for ROS8.2 (#1789) --- content/develop/use/keyspace-notifications.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/develop/use/keyspace-notifications.md b/content/develop/use/keyspace-notifications.md index bfff7d2e99..ebc98e8f0e 100644 --- a/content/develop/use/keyspace-notifications.md +++ b/content/develop/use/keyspace-notifications.md @@ -83,6 +83,8 @@ following table: e Evicted events (events generated when a key is evicted for maxmemory) m Key miss events (events generated when a key that doesn't exist is accessed) n New key events (Note: not included in the 'A' class) + o Overwritten events (events generated every time a key is overwritten) + c Type-changed events (events generated every time a key's type changes) A Alias for "g$lshztxed", so that the "AKE" string means all the events except "m" and "n". At least `K` or `E` should be present in the string, otherwise no event @@ -150,6 +152,8 @@ Different commands generate different kind of events according to the following * Every time a key with a time to live associated is removed from the data set because it expired, an `expired` event is generated. * Every time a key is evicted from the data set in order to free memory as a result of the `maxmemory` policy, an `evicted` event is generated. * Every time a new key is added to the data set, a `new` event is generated. +* Every time a key is being overwritten, an `overwritten` event is generated. +* Every time a key's type changes, a `type_changed` event is generated. **IMPORTANT** all the commands generate events only if the target key is really modified. For instance an [`SREM`]({{< relref "/commands/srem" >}}) deleting a non-existing element from a Set will not actually change the value of the key, so no event will be generated. From 493e989a0fe288a405a52019c87e9b27877294dc Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Thu, 3 Jul 2025 06:16:39 -0700 Subject: [PATCH 06/12] DOC-5366: write new streams docs for ROS8.2 (#1788) * DEV: write new streams docs for ROS8.2 * Apply suggestions from code review --- content/commands/xackdel.md | 163 ++++++++++++++++++++++++++ content/commands/xadd.md | 139 +++++++++++++++------- content/commands/xdelex.md | 149 +++++++++++++++++++++++ content/commands/xtrim.md | 99 +++++++++++++--- content/develop/data-types/streams.md | 67 +++++++++-- 5 files changed, 549 insertions(+), 68 deletions(-) create mode 100644 content/commands/xackdel.md create mode 100644 content/commands/xdelex.md diff --git a/content/commands/xackdel.md b/content/commands/xackdel.md new file mode 100644 index 0000000000..bdbda003fd --- /dev/null +++ b/content/commands/xackdel.md @@ -0,0 +1,163 @@ +--- +acl_categories: +- '@write' +- '@stream' +- '@fast' +arguments: +- display_text: key + key_spec_index: 0 + name: key + type: key +- display_text: group + name: group + type: string +- arguments: + - display_text: keepref + name: keepref + token: KEEPREF + type: pure-token + - display_text: delref + name: delref + token: DELREF + type: pure-token + - display_text: acked + name: acked + token: ACKED + type: pure-token + name: condition + optional: true + type: oneof +- arguments: + - display_text: numids + name: numids + type: integer + - display_text: id + multiple: true + name: id + type: string + name: ids + token: IDS + type: block +arity: -6 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- write +- fast +complexity: O(1) for each entry ID processed. +description: Acknowledges and conditionally deletes one or multiple entries for a stream consumer + group. +group: stream +hidden: false +key_specs: +- RW: true + begin_search: + spec: + index: 1 + type: index + delete: true + find_keys: + spec: + keystep: 1 + lastkey: 0 + limit: 0 + type: range + update: true +linkTitle: XACKDEL +since: 8.2.0 +summary: Acknowledges and conditionally deletes one or multiple entries for a stream consumer group. +syntax_fmt: "XACKDEL key group [KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]" +syntax_str: "group [KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]" +title: XACKDEL +--- + +Acknowledges and conditionally deletes one or multiple entries (messages) for a stream consumer group at the specified `key`. + +`XACKDEL` combines the functionality of [`XACK`]({{< relref "/commands/xack" >}}) and [`XDEL`]({{< relref "/commands/xdel" >}}) in Redis Streams. It acknowledges the specified entry IDs in the given consumer group and simultaneously attempts to delete the corresponding entries from the stream. + +## Required arguments + +
+key + +The name of the stream key. +
+ +
+group + +The name of the consumer group. +
+ +
+IDS numids id [id ...] + +The IDS block specifying which entries to acknowledge and delete: +- `numids`: The number of IDs that follow +- `id [id ...]`: One or more stream entry IDs to acknowledge and delete +
+ +## Optional arguments + +
+KEEPREF | DELREF | ACKED + +Specifies how to handle consumer group references when acknowledging and deleting entries. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default: + +- `KEEPREF` (default): Acknowledges the entries in the specified consumer group and deletes the entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List). +- `DELREF`: Acknowledges the entries in the specified consumer group, deletes the entries from the stream, and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the entries. If an entry ID is not in the stream, but there are dangling references, `XACKDEL` with `DELREF` would still remove all those references. +- `ACKED`: Acknowledges the entries in the specified consumer group and only deletes entries that were read and acknowledged by all consumer groups. +
+ +This command is particularly useful when you want to both acknowledge entry processing and clean up the stream in a single atomic operation, providing fine-grained control over how entry references are handled. + +{{< note >}} +When using multiple consumer groups, users are encouraged to use `XACKDEL` with the `ACKED` option instead of `XACK` and `XDEL`, simplifying the application logic. +{{< /note >}} + +## Examples + +{{% redis-cli %}} +XADD mystream * field1 value1 +XADD mystream * field2 value2 +XGROUP CREATE mystream mygroup 0 +XREADGROUP GROUP mygroup consumer1 COUNT 2 STREAMS mystream > +XPENDING mystream mygroup +XACKDEL mystream mygroup KEEPREF IDS 2 1526919030474-55 1526919030474-56 +XPENDING mystream mygroup +XRANGE mystream - + +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="xackdel-return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist. +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): For each ID: + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 1 if the entry was acknowledged and deleted from the stream. + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): -1 if no such ID exists in the provided stream key. + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option). + +-tab-sep- + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist. +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): For each ID: + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 1 if the entry was acknowledged and deleted from the stream. + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): -1 if no such ID exists in the provided stream key. + * [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option). + +{{< /multitabs >}} diff --git a/content/commands/xadd.md b/content/commands/xadd.md index 363527f12b..b45e2dd906 100644 --- a/content/commands/xadd.md +++ b/content/commands/xadd.md @@ -14,6 +14,22 @@ arguments: since: 6.2.0 token: NOMKSTREAM type: pure-token +- arguments: + - display_text: keepref + name: keepref + token: KEEPREF + type: pure-token + - display_text: delref + name: delref + token: DELREF + type: pure-token + - display_text: acked + name: acked + token: ACKED + type: pure-token + name: condition + optional: true + type: oneof - arguments: - arguments: - display_text: maxlen @@ -98,6 +114,8 @@ history: - Added the `NOMKSTREAM` option, `MINID` trimming strategy and the `LIMIT` option. - - 7.0.0 - Added support for the `-*` explicit ID form. +- - 8.2.0 + - Added the `KEEPREF`, `DELREF` and `ACKED` options. key_specs: - RW: true begin_search: @@ -115,44 +133,93 @@ key_specs: linkTitle: XADD since: 5.0.0 summary: Appends a new message to a stream. Creates the key if it doesn't exist. -syntax_fmt: "XADD key [NOMKSTREAM] [ [= | ~] threshold\n [LIMIT\_\ - count]] <* | id> field value [field value ...]" -syntax_str: "[NOMKSTREAM] [ [= | ~] threshold [LIMIT\_count]] <* |\ - \ id> field value [field value ...]" +syntax_fmt: "XADD key [NOMKSTREAM] [KEEPREF | DELREF | ACKED] [\n\ + \ [= | ~] threshold [LIMIT\_count]] <* | id> field value [field value\n ...]" +syntax_str: "[NOMKSTREAM] [KEEPREF | DELREF | ACKED] [ [= | ~] threshold\ + \ [LIMIT\_count]] <* | id> field value [field value ...]" title: XADD --- -Appends the specified stream entry to the stream at the specified key. -If the key does not exist, as a side effect of running this command the -key is created with a stream value. The creation of stream's key can be -disabled with the `NOMKSTREAM` option. -An entry is composed of a list of field-value pairs. -The field-value pairs are stored in the same order they are given by the user. -Commands that read the stream, such as [`XRANGE`]({{< relref "/commands/xrange" >}}) or [`XREAD`]({{< relref "/commands/xread" >}}), are guaranteed to return the fields and values exactly in the same order they were added by `XADD`. +Appends the specified stream entry to the stream at the specified `key`. +If the key does not exist, `XADD` will create a new key with the given stream value as a side effect of running this command. +You can turn off key creation with the `NOMKSTREAM` option. + +## Required arguments + +
+key + +The name of the stream key. +
+ +
+id + +The stream entry ID. Use `*` to auto-generate a unique ID, or specify a well-formed ID in the format `-` (for example, `1526919030474-55`). +
+ +
+field value [field value ...] -`XADD` is the *only Redis command* that can add data to a stream, but -there are other commands, such as [`XDEL`]({{< relref "/commands/xdel" >}}) and [`XTRIM`]({{< relref "/commands/xtrim" >}}), that are able to +One or more field-value pairs that make up the stream entry. You must provide at least one field-value pair. +
+ +## Optional arguments + +
+NOMKSTREAM + +Prevents the creation of a new stream if the key does not exist. Available since Redis 6.2.0. +
+ +
+KEEPREF | DELREF | ACKED + +Specifies how to handle consumer group references when trimming. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default. Unlike the `XDELEX` and `XACKDEL` commands where one of these options is required, here they are optional to maintain backward compatibility: + +- `KEEPREF` (default): When trimming, removes entries from the stream according to the specified strategy (`MAXLEN` or `MINID`), regardless of whether they are referenced by any consumer groups, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List). +- `DELREF`: When trimming, removes entries from the stream according to the specified strategy and also removes all references to these entries from all consumer groups' PEL. +- `ACKED`: When trimming, only removes entries that were read and acknowledged by all consumer groups. Note that if the number of referenced entries is larger than `MAXLEN`, trimming will still stop at the limit. +
+ +
+MAXLEN | MINID [= | ~] threshold [LIMIT count] + +Trims the stream to maintain a specific size or remove old entries: +- `MAXLEN`: Limits the stream to a maximum number of entries +- `MINID`: Removes entries with IDs lower than the specified threshold (available since Redis 6.2.0) +- `=`: Exact trimming (default) +- `~`: Approximate trimming (more efficient) +- `threshold`: The maximum number of entries (for MAXLEN) or minimum ID (for MINID) +- `LIMIT count`: Limits the number of entries to examine during trimming (available since Redis 6.2.0) +
+ +Each entry consists of a list of field-value pairs. +Redis stores the field-value pairs in the same order you provide them. +Commands that read the stream, such as [`XRANGE`]({{< relref "/commands/xrange" >}}) or [`XREAD`]({{< relref "/commands/xread" >}}), return the fields and values in exactly the same order you added them with `XADD`. + +{{< note >}} +`XADD` is the only Redis command that can add data to a stream. However, +other commands, such as [`XDEL`]({{< relref "/commands/xdel" >}}) and [`XTRIM`]({{< relref "/commands/xtrim" >}}), can remove data from a stream. +{{< /note >}} ## Specifying a Stream ID as an argument -A stream entry ID identifies a given entry inside a stream. +A stream entry ID identifies a specific entry inside a stream. -The `XADD` command will auto-generate a unique ID for you if the ID argument -specified is the `*` character (asterisk ASCII character). However, while -useful only in very rare cases, it is possible to specify a well-formed ID, so -that the new entry will be added exactly with the specified ID. +`XADD` auto-generates a unique ID for you if you specify the `*` character (asterisk) as the ID argument. However, you can also specify a well-formed ID to add the new entry with that exact ID, though this is useful only in rare cases. -IDs are specified by two numbers separated by a `-` character: +Specify IDs using two numbers separated by a `-` character: 1526919030474-55 -Both quantities are 64-bit numbers. When an ID is auto-generated, the +Both numbers are 64-bit integers. When Redis auto-generates an ID, the first part is the Unix time in milliseconds of the Redis instance generating -the ID. The second part is just a sequence number and is used in order to +the ID. The second part is a sequence number used to distinguish IDs generated in the same millisecond. -You can also specify an incomplete ID, that consists only of the milliseconds part, which is interpreted as a zero value for sequence part. +You can also specify an incomplete ID that consists only of the milliseconds part, which Redis interprets as a zero value for the sequence part. To have only the sequence part automatically generated, specify the milliseconds part followed by the `-` separator and the `*` character: ``` @@ -162,37 +229,25 @@ To have only the sequence part automatically generated, specify the milliseconds "1526919030474-56" ``` -IDs are guaranteed to be always incremental: If you compare the ID of the -entry just inserted it will be greater than any other past ID, so entries -are totally ordered inside a stream. In order to guarantee this property, -if the current top ID in the stream has a time greater than the current -local time of the instance, the top entry time will be used instead, and -the sequence part of the ID incremented. This may happen when, for instance, -the local clock jumps backward, or if after a failover the new master has -a different absolute time. - -When a user specified an explicit ID to `XADD`, the minimum valid ID is -`0-1`, and the user *must* specify an ID which is greater than any other -ID currently inside the stream, otherwise the command will fail and return an error. Usually -resorting to specific IDs is useful only if you have another system generating -unique IDs (for instance an SQL table) and you really want the Redis stream -IDs to match the one of this other system. +Redis guarantees that IDs are always incremental: the ID of any entry you insert will be greater than any previous ID, so entries are totally ordered inside a stream. To guarantee this property, if the current top ID in the stream has a time greater than the current local time of the instance, Redis uses the top entry time instead and increments the sequence part of the ID. This may happen when, for instance, the local clock jumps backward, or after a failover when the new master has a different absolute time. + +When you specify an explicit ID to `XADD`, the minimum valid ID is `0-1`, and you *must* specify an ID that is greater than any other ID currently inside the stream, otherwise the command fails and returns an error. Specifying explicit IDs is usually useful only if you have another system generating unique IDs (for instance an SQL table) and you want the Redis stream IDs to match those from your other system. ## Capped streams `XADD` incorporates the same semantics as the [`XTRIM`]({{< relref "/commands/xtrim" >}}) command - refer to its documentation page for more information. -This allows adding new entries and keeping the stream's size in check with a single call to `XADD`, effectively capping the stream with an arbitrary threshold. -Although exact trimming is possible and is the default, due to the internal representation of streams it is more efficient to add an entry and trim stream with `XADD` using **almost exact** trimming (the `~` argument). +This allows you to add new entries and keep the stream's size in check with a single call to `XADD`, effectively capping the stream with an arbitrary threshold. +Although exact trimming is possible and is the default, due to the internal representation of streams, it is more efficient to add an entry and trim the stream with `XADD` using **almost exact** trimming (the `~` argument). For example, calling `XADD` in the following form: XADD mystream MAXLEN ~ 1000 * ... entry fields here ... - -Will add a new entry but will also evict old entries so that the stream will contain only 1000 entries, or at most a few tens more. + +This adds a new entry but also evicts old entries so that the stream contains only 1000 entries, or at most a few tens more. ## Additional information about streams -For further information about Redis streams please check our +For more information about Redis streams, see the [introduction to Redis Streams document]({{< relref "/develop/data-types/streams" >}}). ## Examples diff --git a/content/commands/xdelex.md b/content/commands/xdelex.md new file mode 100644 index 0000000000..35a2858d78 --- /dev/null +++ b/content/commands/xdelex.md @@ -0,0 +1,149 @@ +--- +acl_categories: +- '@write' +- '@stream' +- '@fast' +arguments: +- display_text: key + key_spec_index: 0 + name: key + type: key +- arguments: + - display_text: keepref + name: keepref + token: KEEPREF + type: pure-token + - display_text: delref + name: delref + token: DELREF + type: pure-token + - display_text: acked + name: acked + token: ACKED + type: pure-token + name: condition + optional: true + type: oneof +- arguments: + - display_text: numids + name: numids + type: integer + - display_text: id + multiple: true + name: id + type: string + name: ids + token: IDS + type: block +arity: -5 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- write +- fast +complexity: O(1) for each single item to delete in the stream, regardless of the stream + size. +description: Deletes one or multiple entries from the stream. +group: stream +hidden: false +key_specs: +- RW: true + begin_search: + spec: + index: 1 + type: index + delete: true + find_keys: + spec: + keystep: 1 + lastkey: 0 + limit: 0 + type: range +linkTitle: XDELEX +since: 8.2.0 +summary: Deletes one or multiple entries from the stream. +syntax_fmt: "XDELEX key [KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]" +syntax_str: "[KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]" +title: XDELEX +--- + +Deletes one or multiple entries from the stream at the specified `key`. + +`XDELEX` is an extension of the Redis Streams [`XDEL`]({{< relref "/commands/xdel" >}}) command that provides more control over how message entries are deleted concerning consumer groups. + +## Required arguments + +
+key + +The name of the stream key. +
+ +
+IDS numids id [id ...] + +The IDS block specifying which entries to delete: +- `numids`: The number of IDs that follow +- `id [id ...]`: One or more stream entry IDs to delete + +Note: The IDS block can be at any position in the command, same as other commands. +
+ +## Optional arguments + +
+KEEPREF | DELREF | ACKED + +Specifies how to handle consumer group references when deleting entries. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default: + +- `KEEPREF` (default): Deletes the specified entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List). This behavior is similar to [`XDEL`]({{< relref "/commands/xdel" >}}). +- `DELREF`: Deletes the specified entries from the stream and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the messages. If an entry ID is not in the stream, but there are dangling references, `XDELEX` with `DELREF` would still remove all those references. +- `ACKED`: Only deletes entries that were read and acknowledged by all consumer groups. +
+ +The command provides fine-grained control over stream entry deletion, particularly useful when working with consumer groups where you need to manage pending entry references carefully. + +## Examples + +{{% redis-cli %}} +XADD mystream * field1 value1 +XADD mystream * field2 value2 +XADD mystream * field3 value3 +XRANGE mystream - + +XDELEX mystream KEEPREF IDS 2 1526919030474-55 1526919030474-56 +XRANGE mystream - + +{{% /redis-cli %}} + +## Return information + +{{< multitabs id="xdelex-return-info" + tab1="RESP2" + tab2="RESP3" >}} + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist. +* [Array reply](../../develop/reference/protocol-spec#arrays): For each ID: + * [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key. + * [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream. + * [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option). + +-tab-sep- + +One of the following: + +* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist. +* [Array reply](../../develop/reference/protocol-spec#arrays): For each ID: + * [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key. + * [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream. + * [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option). + +{{< /multitabs >}} diff --git a/content/commands/xtrim.md b/content/commands/xtrim.md index 9086919bd9..fa40922f03 100644 --- a/content/commands/xtrim.md +++ b/content/commands/xtrim.md @@ -42,6 +42,22 @@ arguments: since: 6.2.0 token: LIMIT type: integer + - arguments: + - display_text: keepref + name: keepref + token: KEEPREF + type: pure-token + - display_text: delref + name: delref + token: DELREF + type: pure-token + - display_text: acked + name: acked + token: ACKED + type: pure-token + name: condition + optional: true + type: oneof name: trim type: block arity: -4 @@ -68,6 +84,8 @@ hints: history: - - 6.2.0 - Added the `MINID` trimming strategy and the `LIMIT` option. +- - 8.2.0 + - Added the `KEEPREF`, `DELREF` and `ACKED` options. key_specs: - RW: true begin_search: @@ -84,40 +102,91 @@ key_specs: linkTitle: XTRIM since: 5.0.0 summary: Deletes messages from the beginning of a stream. -syntax_fmt: "XTRIM key [= | ~] threshold [LIMIT\_count]" -syntax_str: " [= | ~] threshold [LIMIT\_count]" +syntax_fmt: "XTRIM key [= | ~] threshold [LIMIT\_count] [KEEPREF\n\ + \ | DELREF | ACKED]" +syntax_str: " [= | ~] threshold [LIMIT\_count] [KEEPREF | DELREF |\ + \ ACKED]" title: XTRIM --- + `XTRIM` trims the stream by evicting older entries (entries with lower IDs) if needed. -Trimming the stream can be done using one of these strategies: +## Required arguments + +
+key + +The name of the stream key. +
+ +
+MAXLEN | MINID + +The trimming strategy: +- `MAXLEN`: Evicts entries as long as the stream's length exceeds the specified threshold +- `MINID`: Evicts entries with IDs lower than the specified threshold (available since Redis 6.2.0) +
+ +
+threshold + +The trimming threshold. For `MAXLEN`, this is a positive integer representing the maximum number of entries. For `MINID`, this is a stream ID. +
+ +## Optional arguments + +
+= | ~ + +The trimming operator: +- `=`: Exact trimming (default) - trims to the exact threshold +- `~`: Approximate trimming - more efficient, may leave slightly more entries than the threshold +
+ +
+LIMIT count + +Limits the number of entries to examine during trimming. Available since Redis 6.2.0. When not specified, Redis uses a default value of 100 * the number of entries in a macro node. Specifying 0 disables the limiting mechanism entirely. +
+ +
+KEEPREF | DELREF | ACKED + +Specifies how to handle consumer group references when trimming. If no option is specified, `KEEPREF` is used by default: + +- `KEEPREF` (default): When trimming, removes entries from the stream according to the specified strategy (`MAXLEN` or `MINID`), regardless of whether they are referenced by any consumer groups, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List). +- `DELREF`: When trimming, removes entries from the stream according to the specified strategy and also removes all references to these entries from all consumer groups' PEL. +- `ACKED`: When trimming, only removes entries that were read and acknowledged by all consumer groups. Note that if the number of referenced entries is larger than `MAXLEN`, trimming will still stop at the limit. +
+ +You can trim the stream using one of these strategies: * `MAXLEN`: Evicts entries as long as the stream's length exceeds the specified `threshold`, where `threshold` is a positive integer. * `MINID`: Evicts entries with IDs lower than `threshold`, where `threshold` is a stream ID. -For example, this will trim the stream to exactly the latest 1000 items: +For example, this trims the stream to exactly the latest 1000 items: ``` XTRIM mystream MAXLEN 1000 ``` -Whereas in this example, all entries that have an ID lower than 649085820-0 will be evicted: +In this example, Redis evicts all entries that have an ID lower than 649085820-0: ``` XTRIM mystream MINID 649085820 ``` -By default, or when provided with the optional `=` argument, the command performs exact trimming. +By default, or when you provide the optional `=` argument, the command performs exact trimming. Depending on the strategy, exact trimming means: -* `MAXLEN`: the trimmed stream's length will be exactly the minimum between its original length and the specified `threshold`. -* `MINID`: the oldest ID in the stream will be exactly the maximum between its original oldest ID and the specified `threshold`. +* `MAXLEN`: The trimmed stream's length will be exactly the minimum between its original length and the specified `threshold`. +* `MINID`: The oldest ID in the stream will be exactly the maximum between its original oldest ID and the specified `threshold`. Nearly exact trimming --- -Because exact trimming may require additional effort from the Redis server, the optional `~` argument can be provided to make it more efficient. +Because exact trimming may require additional effort from the Redis server, you can provide the optional `~` argument to make it more efficient. For example: @@ -125,13 +194,13 @@ For example: XTRIM mystream MAXLEN ~ 1000 ``` -The `~` argument between the `MAXLEN` strategy and the `threshold` means that the user is requesting to trim the stream so its length is **at least** the `threshold`, but possibly slightly more. -In this case, Redis will stop trimming early when performance can be gained (for example, when a whole macro node in the data structure can't be removed). -This makes trimming much more efficient, and it is usually what you want, although after trimming, the stream may have few tens of additional entries over the `threshold`. +The `~` argument between the `MAXLEN` strategy and the `threshold` means that you are requesting to trim the stream so its length is **at least** the `threshold`, but possibly slightly more. +In this case, Redis stops trimming early when performance can be gained (for example, when a whole macro node in the data structure can't be removed). +This makes trimming much more efficient, and it is usually what you want, although after trimming, the stream may have a few tens of additional entries over the `threshold`. -Another way to control the amount of work done by the command when using the `~`, is the `LIMIT` clause. -When used, it specifies the maximal `count` of entries that will be evicted. -When `LIMIT` and `count` aren't specified, the default value of 100 * the number of entries in a macro node will be implicitly used as the `count`. +Another way to control the amount of work done by the command when using `~` is the `LIMIT` clause. +When you use it, it specifies the maximum `count` of entries that will be evicted. +When you don't specify `LIMIT` and `count`, Redis implicitly uses the default value of 100 * the number of entries in a macro node as the `count`. Specifying the value 0 as `count` disables the limiting mechanism entirely. ## Examples diff --git a/content/develop/data-types/streams.md b/content/develop/data-types/streams.md index 7f4b9dfd9f..3a1434401f 100644 --- a/content/develop/data-types/streams.md +++ b/content/develop/data-types/streams.md @@ -9,9 +9,7 @@ categories: - oss - kubernetes - clients -description: 'Introduction to Redis streams - - ' +description: Introduction to Redis streams linkTitle: Streams title: Redis Streams weight: 60 @@ -28,16 +26,18 @@ Examples of Redis stream use cases include: Redis generates a unique ID for each stream entry. You can use these IDs to retrieve their associated entries later or to read and process all subsequent entries in the stream. Note that because these IDs are related to time, the ones shown here may vary and will be different from the IDs you see in your own Redis instance. -Redis streams support several trimming strategies (to prevent streams from growing unbounded) and more than one consumption strategy (see [`XREAD`]({{< relref "/commands/xread" >}}), [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}), and [`XRANGE`]({{< relref "/commands/xrange" >}})). +Redis streams support several trimming strategies (to prevent streams from growing unbounded) and more than one consumption strategy (see [`XREAD`]({{< relref "/commands/xread" >}}), [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}), and [`XRANGE`]({{< relref "/commands/xrange" >}})). Starting with Redis 8.2, the `XACKDEL`, `XDELEX`, `XADD`, and `XTRIM` commands provide fine-grained control over how stream operations interact with multiple consumer groups, simplifying the coordination of message processing across different applications. ## Basic commands + * [`XADD`]({{< relref "/commands/xadd" >}}) adds a new entry to a stream. * [`XREAD`]({{< relref "/commands/xread" >}}) reads one or more entries, starting at a given position and moving forward in time. * [`XRANGE`]({{< relref "/commands/xrange" >}}) returns a range of entries between two supplied entry IDs. * [`XLEN`]({{< relref "/commands/xlen" >}}) returns the length of a stream. - -See the [complete list of stream commands]({{< relref "/commands/" >}}?group=stream). +* [`XDEL`]({{< relref "/commands/xdel" >}}) removes entries from a stream. +* [`XTRIM`]({{< relref "/commands/xtrim" >}}) trims a stream by removing older entries. +See the [complete list of stream commands]({{< relref "/commands/" >}}?group=stream). ## Examples @@ -90,7 +90,6 @@ For details on why, note that streams are implemented as [radix trees](https://e Simply put, Redis streams provide highly efficient inserts and reads. See each command's time complexity for the details. - ## Streams basics Streams are an append-only data structure. The fundamental write command, called [`XADD`]({{< relref "/commands/xadd" >}}), appends a new entry to the specified stream. @@ -393,6 +392,7 @@ Now it's time to zoom in to see the fundamental consumer group commands. They ar * [`XGROUP`]({{< relref "/commands/xgroup" >}}) is used in order to create, destroy and manage consumer groups. * [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}) is used to read from a stream via a consumer group. * [`XACK`]({{< relref "/commands/xack" >}}) is the command that allows a consumer to mark a pending message as correctly processed. +* [`XACKDEL`]({{< relref "/commands/xackdel" >}}) combines acknowledgment and deletion in a single atomic operation with enhanced control over consumer group references. ## Creating a consumer group @@ -681,6 +681,31 @@ The counter that you observe in the [`XPENDING`]({{< relref "/commands/xpending" When there are failures, it is normal that messages will be delivered multiple times, but eventually they usually get processed and acknowledged. However there might be a problem processing some specific message, because it is corrupted or crafted in a way that triggers a bug in the processing code. In such a case what happens is that consumers will continuously fail to process this particular message. Because we have the counter of the delivery attempts, we can use that counter to detect messages that for some reason are not processable. So once the deliveries counter reaches a given large number that you chose, it is probably wiser to put such messages in another stream and send a notification to the system administrator. This is basically the way that Redis Streams implements the *dead letter* concept. +## Working with multiple consumer groups + +Redis Streams can be associated with multiple consumer groups, where each entry is delivered to all the stream's consumer groups. Within each consumer group, consumers handle a portion of the entries collaboratively. This design enables different applications or services to process the same stream data independently. + +When a consumer processes a message, it acknowledges it using the [`XACK`]({{< relref "/commands/xack" >}}) command, which removes the entry reference from the Pending Entries List (PEL) of that specific consumer group. However, the entry remains in the stream and in the PELs of other consumer groups until they also acknowledge it. + +Traditionally, applications needed to implement complex logic to delete entries from the stream only after all consumer groups had acknowledged them. This coordination was challenging to implement correctly and efficiently. + +### Enhanced deletion control in Redis 8.2 + +Starting with Redis 8.2, several commands provide enhanced control over how entries are handled with respect to multiple consumer groups: + +* [`XADD`]({{< relref "/commands/xadd" >}}) with trimming options now supports `KEEPREF`, `DELREF`, and `ACKED` modes +* [`XTRIM`]({{< relref "/commands/xtrim" >}}) supports the same reference handling options +* [`XDELEX`]({{< relref "/commands/xdelex" >}}) provides fine-grained deletion control +* [`XACKDEL`]({{< relref "/commands/xackdel" >}}) combines acknowledgment and deletion atomically + +These options control how consumer group references are handled: + +- **KEEPREF** (default): Preserves existing references to entries in all consumer groups' PELs, maintaining backward compatibility +- **DELREF**: Removes all references to entries from all consumer groups' PELs, effectively cleaning up all traces of the messages +- **ACKED**: Only processes entries that have been acknowledged by all consumer groups + +The `ACKED` option is particularly useful as it automates the complex logic of coordinating deletion across multiple consumer groups, ensuring entries are only removed when all groups have finished processing them. + ## Streams observability Messaging systems that lack observability are very hard to work with. Not knowing who is consuming messages, what messages are pending, the set of consumer groups active in a given stream, makes everything opaque. For this reason, Redis Streams and consumer groups have different ways to observe what is happening. We already covered [`XPENDING`]({{< relref "/commands/xpending" >}}), which allows us to inspect the list of messages that are under processing at a given moment, together with their idle time and number of deliveries. @@ -832,6 +857,21 @@ However, [`XTRIM`]({{< relref "/commands/xtrim" >}}) is designed to accept diffe As [`XTRIM`]({{< relref "/commands/xtrim" >}}) is an explicit command, the user is expected to know about the possible shortcomings of different trimming strategies. +### Trimming with consumer group awareness + +Starting with Redis 8.2, both [`XADD`]({{< relref "/commands/xadd" >}}) with trimming options and [`XTRIM`]({{< relref "/commands/xtrim" >}}) support enhanced control over how trimming interacts with consumer groups through the `KEEPREF`, `DELREF`, and `ACKED` options: + +``` +XADD mystream KEEPREF MAXLEN 1000 * field value +XTRIM mystream ACKED MAXLEN 1000 +``` + +- **KEEPREF** (default): Trims entries according to the strategy but preserves references in consumer group PELs +- **DELREF**: Trims entries and removes all references from consumer group PELs +- **ACKED**: Only trims entries that have been acknowledged by all consumer groups + +The `ACKED` option is particularly useful for maintaining data integrity across multiple consumer groups, ensuring that entries are only removed when all groups have finished processing them. + Another useful eviction strategy that may be added to [`XTRIM`]({{< relref "/commands/xtrim" >}}) in the future, is to remove by a range of IDs to ease use of [`XRANGE`]({{< relref "/commands/xrange" >}}) and [`XTRIM`]({{< relref "/commands/xtrim" >}}) to move data from Redis to other storage systems if needed. ## Special IDs in the streams API @@ -882,7 +922,15 @@ Streams also have a special command for removing items from the middle of a stre 2) "Wood" {{< /clients-example >}} -However in the current implementation, memory is not really reclaimed until a macro node is completely empty, so you should not abuse this feature. +### Enhanced deletion with XDELEX + +Starting with Redis 8.2, the [`XDELEX`]({{< relref "/commands/xdelex" >}}) command provides enhanced control over entry deletion, particularly when working with consumer groups. Like other enhanced commands, it supports `KEEPREF`, `DELREF`, and `ACKED` options: + +``` +XDELEX mystream ACKED IDS 2 1692633198206-0 1692633208557-0 +``` + +This allows you to delete entries only when they have been acknowledged by all consumer groups (`ACKED`), remove all consumer group references (`DELREF`), or preserve existing references (`KEEPREF`). ## Zero length streams @@ -931,9 +979,6 @@ A few remarks: * Here we processed up to 10k messages per iteration, this means that the `COUNT` parameter of [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}) was set to 10000. This adds a lot of latency but is needed in order to allow the slow consumers to be able to keep with the message flow. So you can expect a real world latency that is a lot smaller. * The system used for this benchmark is very slow compared to today's standards. - - - ## Learn more * The [Redis Streams Tutorial]({{< relref "/develop/data-types/streams" >}}) explains Redis streams with many examples. From 58d847e6109a676d74f5fed587295edd1f035f96 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Mon, 7 Jul 2025 08:42:11 -0700 Subject: [PATCH 07/12] DOC-5423: update the modules API page (#1815) * Improve rack-awareness documentation for Kubernetes - Add clear explanation of node labeling requirements for rack-awareness - Emphasize that ALL eligible nodes must be labeled with chosen label - Explain what eligible nodes are (nodes where RS pods can be scheduled) - Suggest topology.kubernetes.io/zone as commonly available label - Clarify that not all platforms have this label by default - Update example to use current topology.kubernetes.io/zone instead of deprecated failure-domain.beta.kubernetes.io/zone - Fix kubectl command formatting (add space after $) - Add warning about operator failing if nodes are missing labels Addresses DOC-1815 * Update content/operate/kubernetes/recommendations/node-selection.md Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> * Update content/operate/kubernetes/recommendations/node-selection.md Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> * Update content/operate/kubernetes/recommendations/node-selection.md Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> * Update content/operate/kubernetes/recommendations/node-selection.md Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> * Update content/operate/kubernetes/recommendations/node-selection.md Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> * Move redisvl documentation * Remove type integration * Add redisvl/_index.md * Fix relrefs * Add aliases * Add missing aliases * DOC-3967 moved/expanded keyspace page * DOC-3967 fixed links to keyspace page * DOC-3967 moved transaction and pipeline pages to reference section * DOC-3967 moved patterns folder to clients * DOC-3967 moved programmability folder into develop * DOC-3967 fixed links to programmability section * DOC-3967 added aliases to programmability pages * DOC-3967 moved pub/sub and keyspace notification pages * DOC-3967 added missing aliases * RDI: Add Reboot step after parameter group step * add link icon to section headers (#1755) * add link icon to section headers * review suggestions * toc embed fix * Attempt to fix the broken on this page ToC for embedded content that includes headers --------- Co-authored-by: Rachel Elledge * mention admission controller (#1791) * relref fix (#1793) * Update content/operate/rc/api/api-reference/openapi.json * fix typo (#1795) * DOC-5419 added commands section * DOC-5419 fixed dodgy link * RS: Adjusted best practices for scalable Redis query engine & add benchmarks (#1687) * DOC-4271 RS: Adjusted best practices for scalable Redis query engine & add benchmarks * Style guide fix for indexes * Fixed broken relrefs after AI/search reorg * RS: Added missing module requirements to recover DB (#1679) * DOC-4564 RS: Added missing module requirements to recover DB * DOC-4564 Added rladmin command to identify module versions required by recoverable DBs * DOC-4564 Copied missing module requirements to recover DB to RS 7.4 and 7.8 versions * RS: Added DB port access requirement for Replica Of between different RS clusters (#1650) * DOC-3829 RS: Added DB port access requirement for Replica Of between different RS clusters * Updated relrefs to correct versions * Update ai-videos.md * Fix search-and-query documentation aliases for backward compatibility ## Critical alias fixes to resolve 404 errors and incorrect redirects: ### Fixed broken basic-constructs aliases: - field-and-type-options.md: Fixed alias to point to correct interact paths - schema-definition.md: Fixed alias to point to correct interact paths - configuration.md: Added missing interact aliases and fixed format ### Fixed directory redirect issues (_index.md files): - Added trailing slash variants for all directory aliases - Fixed indexing/ and query/ URLs that were redirecting to home page - Updated: _index.md, indexing/_index.md, query/_index.md, advanced-concepts/_index.md, administration/_index.md, best-practices/_index.md, deprecated/_index.md ### Added missing aliases: - index-mgmt-best-practices.md: Added missing interact alias - aggregations-syntax.md: Added missing interact alias ### Root causes addressed: - Aliases were incorrectly pointing to /ai/ paths instead of /interact/ paths - Directory aliases needed both with/without trailing slash variants - Some files missing interact aliases entirely These fixes should resolve: - 404 errors on basic-constructs URLs - Directory URLs redirecting to home page instead of correct AI locations - Missing backward compatibility for moved files Addresses DOC-5428 * Update redisvl workflow (#1802) * DEV: (RediSearch) doc expiration capabilities in Redis 8 (#1792) * DEV: (RediSearch) doc expiration capabilities in Redis 8 * Apply suggestions from code review Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> * Apply more suggestions from code review --------- Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> * add leading slash to alias (#1804) * DOC-5423: update the modules API page --------- Co-authored-by: mich-elle-luna Co-authored-by: mich-elle-luna <153109578+mich-elle-luna@users.noreply.github.com> Co-authored-by: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> Co-authored-by: paoloredis Co-authored-by: Andy Stark Co-authored-by: Cameron Bates Co-authored-by: Rachel Elledge Co-authored-by: redisdocsapp[bot] <177626021+redisdocsapp[bot]@users.noreply.github.com> Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> Co-authored-by: JooYoung Lim Co-authored-by: Cameron Bates <102550101+cmilesb@users.noreply.github.com> Co-authored-by: Rachel Elledge <86307637+rrelledge@users.noreply.github.com> Co-authored-by: paoloredis <158162796+paoloredis@users.noreply.github.com> --- .github/workflows/redisvl_docs_sync.yaml | 12 +- assets/css/index.css | 33 ++ content/apis/_index.md | 6 +- content/commands/cluster-info.md | 4 +- content/commands/command.md | 6 +- content/commands/eval.md | 6 +- content/commands/eval_ro.md | 4 +- content/commands/evalsha.md | 2 +- content/commands/evalsha_ro.md | 4 +- content/commands/expire.md | 4 + content/commands/fcall.md | 2 +- content/commands/fcall_ro.md | 4 +- content/commands/ft.aggregate.md | 1 + content/commands/ft.search.md | 1 + content/commands/function-delete.md | 2 +- content/commands/function-dump.md | 2 +- content/commands/function-flush.md | 2 +- content/commands/function-kill.md | 2 +- content/commands/function-list.md | 4 +- content/commands/function-load.md | 4 +- content/commands/function-restore.md | 2 +- content/commands/function-stats.md | 2 +- content/commands/hexpire.md | 6 +- content/commands/hexpireat.md | 2 +- content/commands/hpersist.md | 2 +- content/commands/hpexpire.md | 2 +- content/commands/hpexpireat.md | 2 +- content/commands/info.md | 2 +- content/commands/memory-usage.md | 2 +- content/commands/psubscribe.md | 2 +- content/commands/scan.md | 2 +- content/commands/script-debug.md | 4 +- content/commands/script-exists.md | 2 +- content/commands/script-flush.md | 2 +- content/commands/script-kill.md | 2 +- content/commands/script-load.md | 2 +- content/commands/set.md | 2 +- content/commands/setnx.md | 2 +- content/commands/spublish.md | 2 +- content/commands/ssubscribe.md | 2 +- content/commands/subscribe.md | 2 +- content/commands/sunsubscribe.md | 2 +- content/develop/ai/_index.md | 2 +- content/develop/ai/ai-videos.md | 2 + content/develop/ai/redisvl/_index.md | 30 ++ .../ai}/redisvl/api/_index.md | 3 +- .../ai}/redisvl/api/cache.md | 3 +- .../ai}/redisvl/api/filter.md | 3 +- .../ai}/redisvl/api/message_history.md | 3 +- .../ai}/redisvl/api/query.md | 3 +- .../ai}/redisvl/api/reranker.md | 3 +- .../ai}/redisvl/api/router.md | 3 +- .../ai}/redisvl/api/schema.md | 3 +- .../ai}/redisvl/api/searchindex.md | 3 +- .../ai}/redisvl/api/session_manager.md | 3 +- .../ai}/redisvl/api/threshold_optimizer.md | 3 +- .../ai}/redisvl/api/vectorizer.md | 3 +- .../ai}/redisvl/install.md | 5 +- .../ai}/redisvl/overview/_index.md | 3 +- .../ai}/redisvl/overview/cli.md | 3 +- .../ai}/redisvl/overview/installation.md | 3 +- .../ai}/redisvl/user_guide/_index.md | 3 +- .../redisvl/user_guide/embeddings_cache.md | 3 +- .../ai}/redisvl/user_guide/getting_started.md | 3 +- .../ai}/redisvl/user_guide/hash_vs_json.md | 3 +- .../ai}/redisvl/user_guide/hybrid_queries.md | 3 +- .../ai}/redisvl/user_guide/llmcache.md | 3 +- .../ai}/redisvl/user_guide/message_history.md | 3 +- .../user_guide/release_guide/0_5_0_release.md | 3 +- .../user_guide/release_guide/_index.md | 3 +- .../ai}/redisvl/user_guide/rerankers.md | 3 +- .../ai}/redisvl/user_guide/semantic_router.md | 3 +- .../ai}/redisvl/user_guide/session_manager.md | 3 +- .../user_guide/threshold_optimization.md | 3 +- .../ai}/redisvl/user_guide/vectorizers.md | 3 +- content/develop/ai/search-and-query/_index.md | 1 + .../search-and-query/administration/_index.md | 3 +- .../administration/configuration.md | 4 +- .../advanced-concepts/_index.md | 4 +- .../advanced-concepts/autocomplete.md | 2 +- .../advanced-concepts/expiration.md | 79 +++++ .../search-and-query/best-practices/_index.md | 3 +- .../index-mgmt-best-practices.md | 4 +- .../ai/search-and-query/deprecated/_index.md | 3 +- .../ai/search-and-query/indexing/_index.md | 3 +- .../indexing/field-and-type-options.md | 3 +- .../indexing/schema-definition.md | 3 +- .../ai/search-and-query/query/_index.md | 3 + .../develop/ai/search-and-query/vectors.md | 2 +- content/develop/clients/_index.md | 2 +- content/develop/clients/dotnet/condexec.md | 2 +- content/develop/clients/dotnet/transpipe.md | 6 +- content/develop/clients/go/transpipe.md | 6 +- content/develop/clients/hiredis/transpipe.md | 6 +- content/develop/clients/jedis/transpipe.md | 6 +- content/develop/clients/nodejs/amr.md | 2 +- content/develop/clients/nodejs/connect.md | 2 +- content/develop/clients/nodejs/migration.md | 2 +- content/develop/clients/nodejs/transpipe.md | 6 +- .../{use => clients}/patterns/_index.md | 7 +- .../{use => clients}/patterns/bulk-loading.md | 1 + .../patterns/distributed-locks.md | 1 + .../patterns/indexes/2idx_0.png | Bin .../patterns/indexes/2idx_1.png | Bin .../patterns/indexes/2idx_2.png | Bin .../patterns/indexes/index.md | 0 .../patterns/twitter-clone.md | 1 + content/develop/clients/pools-and-muxing.md | 2 +- content/develop/clients/redis-py/transpipe.md | 6 +- content/develop/clients/redis-vl.md | 2 +- content/develop/data-types/_index.md | 6 +- content/develop/data-types/hashes.md | 2 +- content/develop/get-started/data-store.md | 2 +- content/develop/get-started/redis-in-ai.md | 2 +- .../develop/get-started/vector-database.md | 2 +- content/develop/interact/_index.md | 87 ----- .../{interact => }/programmability/_index.md | 17 +- .../programmability/eval-intro.md | 33 +- .../programmability/functions-intro.md | 25 +- .../{interact => }/programmability/lua-api.md | 27 +- .../programmability/lua-debugging.md | 1 + .../{interact/pubsub.md => pubsub/_index.md} | 6 +- .../{use => pubsub}/keyspace-notifications.md | 1 + .../reference/modules/modules-api-ref.md | 301 +++++++++++++++++- content/develop/reference/protocol-spec.md | 6 +- content/develop/tools/cli.md | 6 +- content/develop/use/_index.md | 16 - .../develop/use/pipelining/pipeline_iops.png | Bin 20207 -> 0 bytes content/develop/using-commands/_index.md | 71 +++++ .../{use => using-commands}/keyspace.md | 81 ++++- .../index.md => using-commands/pipelining.md} | 5 +- .../transactions.md | 1 + content/embeds/r7.2-breaking-changes.md | 2 +- .../embeds/r7.2-combined-breaking-changes.md | 2 +- content/get-started/_index.md | 2 +- content/glossary/_index.md | 14 +- .../aws-aurora-rds/aws-aur-mysql.md | 9 +- .../aws-aurora-rds/aws-aur-pgsql.md | 2 + content/integrate/redisvl/_index.md | 9 +- .../quickstart/write-behind-guide.md | 2 +- content/operate/_index.md | 4 +- .../operate/kubernetes/architecture/_index.md | 2 +- .../kubernetes/deployment/container-images.md | 16 +- .../recommendations/node-selection.md | 11 +- .../triggers-and-functions/Debugging.md | 2 +- .../triggers-and-functions/Quick_Start_CLI.md | 2 +- .../triggers-and-functions/Quick_Start_RI.md | 2 +- .../concepts/triggers/KeySpace_Triggers.md | 2 +- .../gears-v1/register-events.md | 4 +- .../search/scalable-query-best-practices.md | 117 ++++++- .../operate/rc/api/api-reference/openapi.json | 119 +------ .../rc/databases/configuration/sizing.md | 2 +- .../data-access-control/configure-acls.md | 4 +- .../import-export/replica-of/create.md | 6 + content/operate/rs/7.4/databases/recover.md | 73 ++++- .../compatibility/commands/server.md | 24 +- .../access-control/redis-acl-overview.md | 4 +- .../import-export/replica-of/create.md | 6 + content/operate/rs/7.8/databases/recover.md | 73 ++++- .../compatibility/commands/server.md | 24 +- .../access-control/redis-acl-overview.md | 4 +- .../import-export/replica-of/create.md | 6 + content/operate/rs/databases/recover.md | 73 ++++- .../compatibility/commands/server.md | 24 +- .../rs-7-2-4-releases/rs-7-2-4-52.md | 6 +- .../access-control/redis-acl-overview.md | 4 +- layouts/_default/_markup/render-heading.html | 11 + layouts/partials/docs-toc.html | 6 +- .../images/dev/reference/pipeline_iops.webp | Bin 0 -> 3144 bytes static/js/index.js | 65 ++++ 170 files changed, 1361 insertions(+), 533 deletions(-) create mode 100644 content/develop/ai/redisvl/_index.md rename content/{integrate => develop/ai}/redisvl/api/_index.md (98%) rename content/{integrate => develop/ai}/redisvl/api/cache.md (99%) rename content/{integrate => develop/ai}/redisvl/api/filter.md (99%) rename content/{integrate => develop/ai}/redisvl/api/message_history.md (99%) rename content/{integrate => develop/ai}/redisvl/api/query.md (99%) rename content/{integrate => develop/ai}/redisvl/api/reranker.md (99%) rename content/{integrate => develop/ai}/redisvl/api/router.md (99%) rename content/{integrate => develop/ai}/redisvl/api/schema.md (99%) rename content/{integrate => develop/ai}/redisvl/api/searchindex.md (99%) rename content/{integrate => develop/ai}/redisvl/api/session_manager.md (99%) rename content/{integrate => develop/ai}/redisvl/api/threshold_optimizer.md (75%) rename content/{integrate => develop/ai}/redisvl/api/vectorizer.md (99%) rename content/{integrate => develop/ai}/redisvl/install.md (91%) rename content/{integrate => develop/ai}/redisvl/overview/_index.md (92%) rename content/{integrate => develop/ai}/redisvl/overview/cli.md (99%) rename content/{integrate => develop/ai}/redisvl/overview/installation.md (98%) rename content/{integrate => develop/ai}/redisvl/user_guide/_index.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/embeddings_cache.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/getting_started.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/hash_vs_json.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/hybrid_queries.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/llmcache.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/message_history.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/release_guide/0_5_0_release.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/release_guide/_index.md (93%) rename content/{integrate => develop/ai}/redisvl/user_guide/rerankers.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/semantic_router.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/session_manager.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/threshold_optimization.md (99%) rename content/{integrate => develop/ai}/redisvl/user_guide/vectorizers.md (99%) create mode 100644 content/develop/ai/search-and-query/advanced-concepts/expiration.md rename content/develop/{use => clients}/patterns/_index.md (72%) rename content/develop/{use => clients}/patterns/bulk-loading.md (99%) rename content/develop/{use => clients}/patterns/distributed-locks.md (99%) rename content/develop/{use => clients}/patterns/indexes/2idx_0.png (100%) rename content/develop/{use => clients}/patterns/indexes/2idx_1.png (100%) rename content/develop/{use => clients}/patterns/indexes/2idx_2.png (100%) rename content/develop/{use => clients}/patterns/indexes/index.md (100%) rename content/develop/{use => clients}/patterns/twitter-clone.md (99%) delete mode 100644 content/develop/interact/_index.md rename content/develop/{interact => }/programmability/_index.md (87%) rename content/develop/{interact => }/programmability/eval-intro.md (92%) rename content/develop/{interact => }/programmability/functions-intro.md (93%) rename content/develop/{interact => }/programmability/lua-api.md (96%) rename content/develop/{interact => }/programmability/lua-debugging.md (99%) rename content/develop/{interact/pubsub.md => pubsub/_index.md} (99%) rename content/develop/{use => pubsub}/keyspace-notifications.md (99%) delete mode 100644 content/develop/use/_index.md delete mode 100644 content/develop/use/pipelining/pipeline_iops.png create mode 100644 content/develop/using-commands/_index.md rename content/develop/{use => using-commands}/keyspace.md (64%) rename content/develop/{use/pipelining/index.md => using-commands/pipelining.md} (98%) rename content/develop/{interact => using-commands}/transactions.md (99%) create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 static/images/dev/reference/pipeline_iops.webp diff --git a/.github/workflows/redisvl_docs_sync.yaml b/.github/workflows/redisvl_docs_sync.yaml index 8ec3bd4fcf..38582024dd 100644 --- a/.github/workflows/redisvl_docs_sync.yaml +++ b/.github/workflows/redisvl_docs_sync.yaml @@ -66,7 +66,6 @@ jobs: --- linkTitle: ${linkTitle} title: ${title} - type: integration EOL # Inject weight property for index pages to preserve order @@ -107,7 +106,6 @@ jobs: # Convert jupyter notebooks to markdown jupyter nbconvert --to markdown build/jupyter_execute/user_guide/*.ipynb --output-dir redis_vl_hugo/user_guide/ 2>/dev/null - jupyter nbconvert --to markdown build/jupyter_execute/user_guide/release_guide/*.ipynb --output-dir redis_vl_hugo/user_guide/release_guide/ 2>/dev/null jupyter nbconvert --to markdown build/jupyter_execute/overview/cli.ipynb --output-dir redis_vl_hugo/overview/ 2>/dev/null # Prepare markdown files @@ -125,7 +123,7 @@ jobs: sed -E -i 's/^> *//g; s/\x1b\[[0-9;]*m//g' "${markdown_page}" # Replace https://docs.redisvl.com links - sed -E -i 's#https://docs.redisvl.com/en/latest/.+/([^_]+).+\.html(\#[^)]+)#{{< relref "\1\2" >}}#g; s#https://docs.redisvl.com/en/latest/(.+)\.html#https://redis.io/docs/latest/integrate/redisvl/\1#g' "${markdown_page}" + sed -E -i 's#https://docs.redisvl.com/en/latest/.+/([^_]+).+\.html(\#[^)]+)#{{< relref "\1\2" >}}#g; s#https://docs.redisvl.com/en/latest/(.+)\.html#https://redis.io/docs/latest/develop/ai/redisvl/\1#g' "${markdown_page}" done # Fix links in api pages @@ -210,13 +208,11 @@ jobs: # Format _index.md pages cp ./build/markdown/api/index.md ./redis_vl_hugo/api/_index.md cp ./build/markdown/user_guide/index.md ./redis_vl_hugo/user_guide/_index.md - cp ./build/markdown/user_guide/release_guide/index.md ./redis_vl_hugo/user_guide/release_guide/_index.md cp ./build/markdown/overview/index.md ./redis_vl_hugo/overview/_index.md index_markdown_pages=( ./redis_vl_hugo/api/_index.md ./redis_vl_hugo/user_guide/_index.md - ./redis_vl_hugo/user_guide/release_guide/_index.md ./redis_vl_hugo/overview/_index.md ) @@ -236,7 +232,7 @@ jobs: fi done - cp -r redis_vl_hugo/* content/integrate/redisvl/ + cp -r redis_vl_hugo/* content/develop/ai/redisvl/ - name: 'Create pull request if necessary' env: @@ -262,12 +258,12 @@ jobs: git checkout -b "${branch}" fi - redisvl_is_different=$(git diff content/integrate/redisvl/) + redisvl_is_different=$(git diff content/develop/ai/redisvl/) if [[ ! -z $redisvl_is_different ]]; then redisvl_change=true - git add "content/integrate/redisvl/" + git add "content/develop/ai/redisvl/" git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com" git config user.name "redisdocsapp[bot]" git commit -m "Update for redisvl ${release}" diff --git a/assets/css/index.css b/assets/css/index.css index 2e63117dd4..cb4b11bf18 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -47,6 +47,39 @@ section.prose { @apply text-sm font-medium; } +/* Header link styles */ +.header-link { + @apply text-slate-400 hover:text-slate-600 transition-all duration-200 no-underline cursor-pointer; + text-decoration: none !important; + vertical-align: baseline; +} + +.header-link:hover { + @apply text-slate-600; + text-decoration: none !important; +} + +.header-link svg { + @apply w-4 h-4 inline-block; + vertical-align: baseline; +} + +/* Ensure header links don't interfere with prose styling */ +.prose h1 .header-link, +.prose h2 .header-link, +.prose h3 .header-link, +.prose h4 .header-link, +.prose h5 .header-link, +.prose h6 .header-link { + @apply text-slate-400 hover:text-slate-600; + text-decoration: none !important; +} + +/* Feedback state for copied links */ +.header-link.copied { + @apply text-green-500; +} + .prose p, .prose ol, .prose ul { @apply text-base; } diff --git a/content/apis/_index.md b/content/apis/_index.md index eaef82dbfe..4a5ca54c45 100644 --- a/content/apis/_index.md +++ b/content/apis/_index.md @@ -26,12 +26,12 @@ The existing Redis commands cover most use cases, but if low latency is a critic Lua scripts have been available since early versions of Redis. With Lua, the script is provided by the client and cached on the server side, which implies the risk that different clients might use a different script version. -- [Redis Lua API reference]({{< relref "/develop/interact/programmability/lua-api" >}}) -- [Scripting with Lua introduction]({{< relref "/develop/interact/programmability/eval-intro" >}}) +- [Redis Lua API reference]({{< relref "/develop/programmability/lua-api" >}}) +- [Scripting with Lua introduction]({{< relref "/develop/programmability/eval-intro" >}}) The Redis functions feature, which became available in Redis 7, supersedes the use of Lua in prior versions of Redis. The client is still responsible for invoking the execution, but unlike the previous Lua scripts, functions can now be replicated and persisted. -- [Functions and scripting in Redis 7 and beyond]({{< relref "/develop/interact/programmability/functions-intro" >}}) +- [Functions and scripting in Redis 7 and beyond]({{< relref "/develop/programmability/functions-intro" >}}) If none of the previous methods fulfills your needs, then you can extend the functionality of Redis with new commands using the Redis Modules API. diff --git a/content/commands/cluster-info.md b/content/commands/cluster-info.md index 4b38d899f0..4d83b462c6 100644 --- a/content/commands/cluster-info.md +++ b/content/commands/cluster-info.md @@ -66,13 +66,13 @@ Here are the explanation of these fields: * `cluster_stats_messages_pong_sent` and `cluster_stats_messages_pong_received`: PONG (reply to PING). * `cluster_stats_messages_meet_sent` and `cluster_stats_messages_meet_received`: Handshake message sent to a new node, either through gossip or [`CLUSTER MEET`]({{< relref "/commands/cluster-meet" >}}). * `cluster_stats_messages_fail_sent` and `cluster_stats_messages_fail_received`: Mark node xxx as failing. -* `cluster_stats_messages_publish_sent` and `cluster_stats_messages_publish_received`: Pub/Sub Publish propagation, see [Pubsub]({{< relref "/develop/interact/pubsub#pubsub" >}}). +* `cluster_stats_messages_publish_sent` and `cluster_stats_messages_publish_received`: Pub/Sub Publish propagation, see [Pubsub]({{< relref "/develop/pubsub#pubsub" >}}). * `cluster_stats_messages_auth-req_sent` and `cluster_stats_messages_auth-req_received`: Replica initiated leader election to replace its master. * `cluster_stats_messages_auth-ack_sent` and `cluster_stats_messages_auth-ack_received`: Message indicating a vote during leader election. * `cluster_stats_messages_update_sent` and `cluster_stats_messages_update_received`: Another node slots configuration. * `cluster_stats_messages_mfstart_sent` and `cluster_stats_messages_mfstart_received`: Pause clients for manual failover. * `cluster_stats_messages_module_sent` and `cluster_stats_messages_module_received`: Module cluster API message. -* `cluster_stats_messages_publishshard_sent` and `cluster_stats_messages_publishshard_received`: Pub/Sub Publish shard propagation, see [Sharded Pubsub]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}). +* `cluster_stats_messages_publishshard_sent` and `cluster_stats_messages_publishshard_received`: Pub/Sub Publish shard propagation, see [Sharded Pubsub]({{< relref "/develop/pubsub#sharded-pubsub" >}}). More information about the Current Epoch and Config Epoch variables are available in the [Redis Cluster specification document]({{< relref "/operate/oss_and_stack/reference/cluster-spec#cluster-current-epoch" >}}). diff --git a/content/commands/command.md b/content/commands/command.md index c305658283..60f7487e41 100644 --- a/content/commands/command.md +++ b/content/commands/command.md @@ -101,9 +101,9 @@ Command flags are an array. It can contain the following simple strings (status * **no_auth:** executing the command doesn't require authentication. * **no_async_loading:** the command is denied during asynchronous loading (that is when a replica uses disk-less `SWAPDB SYNC`, and allows access to the old dataset). * **no_mandatory_keys:** the command may accept key name arguments, but these aren't mandatory. -* **no_multi:** the command isn't allowed inside the context of a [transaction]({{< relref "/develop/interact/transactions" >}}). -* **noscript:** the command can't be called from [scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) or [functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). -* **pubsub:** the command is related to [Redis Pub/Sub]({{< relref "/develop/interact/pubsub" >}}). +* **no_multi:** the command isn't allowed inside the context of a [transaction]({{< relref "develop/using-commands/transactions" >}}). +* **noscript:** the command can't be called from [scripts]({{< relref "/develop/programmability/eval-intro" >}}) or [functions]({{< relref "/develop/programmability/functions-intro" >}}). +* **pubsub:** the command is related to [Redis Pub/Sub]({{< relref "/develop/pubsub" >}}). * **random**: the command returns random results, which is a concern with verbatim script replication. As of Redis 7.0, this flag is a [command tip][tb]. * **readonly:** the command doesn't modify data. diff --git a/content/commands/eval.md b/content/commands/eval.md index 01575fc40a..d3706a389b 100644 --- a/content/commands/eval.md +++ b/content/commands/eval.md @@ -66,10 +66,10 @@ title: EVAL Invoke the execution of a server-side Lua script. The first argument is the script's source code. -Scripts are written in [Lua](https://lua.org) and executed by the embedded [Lua 5.1]({{< relref "develop/interact/programmability/lua-api" >}}) interpreter in Redis. +Scripts are written in [Lua](https://lua.org) and executed by the embedded [Lua 5.1]({{< relref "develop/programmability/lua-api" >}}) interpreter in Redis. The second argument is the number of input key name arguments, followed by all the keys accessed by the script. -These names of input keys are available to the script as the [_KEYS_ global runtime variable]({{< relref "develop/interact/programmability/lua-api#the-keys-global-variable" >}}) +These names of input keys are available to the script as the [_KEYS_ global runtime variable]({{< relref "develop/programmability/lua-api#the-keys-global-variable" >}}) Any additional input arguments **should not** represent names of keys. **Important:** @@ -83,7 +83,7 @@ These are added to the Lua interpreter and cached to redis-server, consuming a l Starting from Redis 7.4, scripts loaded with `EVAL` or [`EVAL_RO`]({{< relref "/commands/eval_ro" >}}) will be deleted from redis after a certain number (least recently used order). The number of evicted scripts can be viewed through [`INFO`]({{< relref "/commands/info" >}})'s `evicted_scripts`. -Please refer to the [Redis Programmability]({{< relref "/develop/interact/programmability/" >}}) and [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) for more information about Lua scripts. +Please refer to the [Redis Programmability]({{< relref "/develop/programmability/" >}}) and [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}) for more information about Lua scripts. ## Examples diff --git a/content/commands/eval_ro.md b/content/commands/eval_ro.md index b50d27b9fb..587c5af89a 100644 --- a/content/commands/eval_ro.md +++ b/content/commands/eval_ro.md @@ -65,9 +65,9 @@ title: EVAL_RO --- This is a read-only variant of the [`EVAL`]({{< relref "/commands/eval" >}}) command that cannot execute commands that modify data. -For more information about when to use this command vs [`EVAL`]({{< relref "/commands/eval" >}}), please refer to [Read-only scripts]({{< relref "develop/interact/programmability#read-only-scripts" >}}). +For more information about when to use this command vs [`EVAL`]({{< relref "/commands/eval" >}}), please refer to [Read-only scripts]({{< relref "develop/programmability#read-only-scripts" >}}). -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Examples diff --git a/content/commands/evalsha.md b/content/commands/evalsha.md index c3bb476552..d43d493241 100644 --- a/content/commands/evalsha.md +++ b/content/commands/evalsha.md @@ -67,7 +67,7 @@ Evaluate a script from the server's cache by its SHA1 digest. The server caches scripts by using the [`SCRIPT LOAD`]({{< relref "/commands/script-load" >}}) command. The command is otherwise identical to [`EVAL`]({{< relref "/commands/eval" >}}). -Please refer to the [Redis Programmability]({{< relref "/develop/interact/programmability/" >}}) and [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) for more information about Lua scripts. +Please refer to the [Redis Programmability]({{< relref "/develop/programmability/" >}}) and [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}) for more information about Lua scripts. ## Return information diff --git a/content/commands/evalsha_ro.md b/content/commands/evalsha_ro.md index 3ded3ba264..e73c6051c5 100644 --- a/content/commands/evalsha_ro.md +++ b/content/commands/evalsha_ro.md @@ -64,9 +64,9 @@ title: EVALSHA_RO --- This is a read-only variant of the [`EVALSHA`]({{< relref "/commands/evalsha" >}}) command that cannot execute commands that modify data. -For more information about when to use this command vs [`EVALSHA`]({{< relref "/commands/evalsha" >}}), please refer to [Read-only scripts]({{< relref "develop/interact/programmability#read-only-scripts" >}}). +For more information about when to use this command vs [`EVALSHA`]({{< relref "/commands/evalsha" >}}), please refer to [Read-only scripts]({{< relref "develop/programmability#read-only-scripts" >}}). -For more information about [`EVALSHA`]({{< relref "/commands/evalsha" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVALSHA`]({{< relref "/commands/evalsha" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Return information diff --git a/content/commands/expire.md b/content/commands/expire.md index 3b3f663330..cde9c4251a 100644 --- a/content/commands/expire.md +++ b/content/commands/expire.md @@ -266,6 +266,10 @@ still take the full state of the expires existing in the dataset, so when a replica is elected to master it will be able to expire the keys independently, fully acting as a master. +### Redis Query Engine and expiration + +Starting with Redis 8, the Redis Query Engine has enhanced behavior when handling expiring keys. For detailed information about how [`FT.SEARCH`]({{< relref "/commands/ft.search" >}}) and [`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate" >}}) commands interact with expiring keys, see [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}). + ## Return information {{< multitabs id="expire-return-info" diff --git a/content/commands/fcall.md b/content/commands/fcall.md index 3494b41816..5ae677795e 100644 --- a/content/commands/fcall.md +++ b/content/commands/fcall.md @@ -79,7 +79,7 @@ Functions **should never** access keys with programmatically-generated names or Any additional input argument **should not** represent names of keys. These are regular arguments and are passed in a Lua table as the callback's second argument. -For more information please refer to the [Redis Programmability]({{< relref "/develop/interact/programmability/" >}}) and [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}) pages. +For more information please refer to the [Redis Programmability]({{< relref "/develop/programmability/" >}}) and [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}) pages. ## Examples diff --git a/content/commands/fcall_ro.md b/content/commands/fcall_ro.md index 0cef2a52ac..8424a4e3cd 100644 --- a/content/commands/fcall_ro.md +++ b/content/commands/fcall_ro.md @@ -65,9 +65,9 @@ title: FCALL_RO --- This is a read-only variant of the [`FCALL`]({{< relref "/commands/fcall" >}}) command that cannot execute commands that modify data. -For more information about when to use this command vs [`FCALL`]({{< relref "/commands/fcall" >}}), please refer to [Read-only scripts]({{< relref "develop/interact/programmability/#read-only_scripts" >}}). +For more information about when to use this command vs [`FCALL`]({{< relref "/commands/fcall" >}}), please refer to [Read-only scripts]({{< relref "develop/programmability/#read-only_scripts" >}}). -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/ft.aggregate.md b/content/commands/ft.aggregate.md index ebd13fcb36..47aa2b4d28 100644 --- a/content/commands/ft.aggregate.md +++ b/content/commands/ft.aggregate.md @@ -496,5 +496,6 @@ Next, count GitHub events by user (actor), to produce the most active users. ## Related topics - [Aggregations]({{< relref "/develop/ai/search-and-query/advanced-concepts/aggregations" >}}) +- [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) - [RediSearch]({{< relref "/develop/ai/search-and-query" >}}) diff --git a/content/commands/ft.search.md b/content/commands/ft.search.md index 4961a64fc5..48d87fc42f 100644 --- a/content/commands/ft.search.md +++ b/content/commands/ft.search.md @@ -860,5 +860,6 @@ Query with `CONTAINS` operator: - [Extensions]({{< relref "/develop/ai/search-and-query/administration/extensions" >}}) - [Highlighting]({{< relref "/develop/ai/search-and-query/advanced-concepts/highlight" >}}) +- [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) - [Query syntax]({{< relref "/develop/ai/search-and-query/query/" >}}) - [RediSearch]({{< relref "/develop/ai/search-and-query/" >}}) diff --git a/content/commands/function-delete.md b/content/commands/function-delete.md index 3da46522b7..c115290e45 100644 --- a/content/commands/function-delete.md +++ b/content/commands/function-delete.md @@ -40,7 +40,7 @@ Delete a library and all its functions. This command deletes the library called _library-name_ and all functions in it. If the library doesn't exist, the server returns an error. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Examples diff --git a/content/commands/function-dump.md b/content/commands/function-dump.md index fa1fab6809..b419502e57 100644 --- a/content/commands/function-dump.md +++ b/content/commands/function-dump.md @@ -29,7 +29,7 @@ title: FUNCTION DUMP Return the serialized payload of loaded libraries. You can restore the serialized payload later with the [`FUNCTION RESTORE`]({{< relref "/commands/function-restore" >}}) command. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Examples diff --git a/content/commands/function-flush.md b/content/commands/function-flush.md index e151ad330c..9717d233d3 100644 --- a/content/commands/function-flush.md +++ b/content/commands/function-flush.md @@ -51,7 +51,7 @@ Unless called with the optional mode argument, the `lazyfree-lazy-user-flush` co * `ASYNC`: Asynchronously flush the libraries. * `SYNC`: Synchronously flush the libraries. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/function-kill.md b/content/commands/function-kill.md index 120afd60c1..75d4cf2453 100644 --- a/content/commands/function-kill.md +++ b/content/commands/function-kill.md @@ -35,7 +35,7 @@ Kill a function that is currently executing. The `FUNCTION KILL` command can be used only on functions that did not modify the dataset during their execution (since stopping a read-only function does not violate the scripting engine's guaranteed atomicity). -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/function-list.md b/content/commands/function-list.md index 21e4eb251f..d02f63170c 100644 --- a/content/commands/function-list.md +++ b/content/commands/function-list.md @@ -52,10 +52,10 @@ The following information is provided for each of the libraries in the response: Each function has the following fields: * **name:** the name of the function. * **description:** the function's description. - * **flags:** an array of [function flags]({{< relref "develop/interact/programmability/functions-intro#function-flags" >}}). + * **flags:** an array of [function flags]({{< relref "develop/programmability/functions-intro#function-flags" >}}). * **library_code:** the library's source code (when given the `WITHCODE` modifier). -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/function-load.md b/content/commands/function-load.md index ba8fb25d7c..a460f1c082 100644 --- a/content/commands/function-load.md +++ b/content/commands/function-load.md @@ -47,7 +47,7 @@ The command's gets a single mandatory parameter which is the source code that im The library payload must start with Shebang statement that provides a metadata about the library (like the engine to use and the library name). Shebang format: `#! name=`. Currently engine name must be `lua`. -For the Lua engine, the implementation should declare one or more entry points to the library with the [`redis.register_function()` API]({{< relref "develop/interact/programmability/lua-api#redis.register_function" >}}). +For the Lua engine, the implementation should declare one or more entry points to the library with the [`redis.register_function()` API]({{< relref "develop/programmability/lua-api#redis.register_function" >}}). Once loaded, you can call the functions in the library with the [`FCALL`]({{< relref "/commands/fcall" >}}) (or [`FCALL_RO`]({{< relref "/commands/fcall_ro" >}}) when applicable) command. When attempting to load a library with a name that already exists, the Redis server returns an error. @@ -61,7 +61,7 @@ The command will return an error in the following circumstances: * The engine failed in creating the library's functions (due to a compilation error, for example). * No functions were declared by the library. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Examples diff --git a/content/commands/function-restore.md b/content/commands/function-restore.md index 9da135b6ce..2f116c8a9e 100644 --- a/content/commands/function-restore.md +++ b/content/commands/function-restore.md @@ -62,7 +62,7 @@ The following policies are allowed: * **FLUSH:** deletes all existing libraries before restoring the payload. * **REPLACE:** appends the restored libraries to the existing libraries, replacing any existing ones in case of name collisions. Note that this policy doesn't prevent function name collisions, only libraries. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/function-stats.md b/content/commands/function-stats.md index a83e1b2493..fb72c33317 100644 --- a/content/commands/function-stats.md +++ b/content/commands/function-stats.md @@ -47,7 +47,7 @@ The reply is map with two keys: You can use this command to inspect the invocation of a long-running function and decide whether kill it with the [`FUNCTION KILL`]({{< relref "/commands/function-kill" >}}) command. -For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). +For more information please refer to [Introduction to Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}). ## Return information diff --git a/content/commands/hexpire.md b/content/commands/hexpire.md index ff88e09161..57035b8803 100644 --- a/content/commands/hexpire.md +++ b/content/commands/hexpire.md @@ -113,13 +113,17 @@ You can call `HEXPIRE` using as argument a field that already has an existing TTL set. In this case, the time to live is _updated_ to the new value. +## Redis Query Engine and field expiration + +Starting with Redis 8, the Redis Query Engine has enhanced behavior when handling expiring hash fields. For detailed information about how [`FT.SEARCH`]({{< relref "/commands/ft.search" >}}) and [`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate" >}}) commands interact with expiring hash fields, see [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}). + ## Example ``` redis> HEXPIRE no-key 20 NX FIELDS 2 field1 field2 (nil) redis> HSET mykey field1 "hello" field2 "world" -(integer 2) +(integer) 2 redis> HEXPIRE mykey 10 FIELDS 3 field1 field2 field3 1) (integer) 1 2) (integer) 1 diff --git a/content/commands/hexpireat.md b/content/commands/hexpireat.md index 5dbc11e3ac..0fd3e5f2d2 100644 --- a/content/commands/hexpireat.md +++ b/content/commands/hexpireat.md @@ -106,7 +106,7 @@ The `NS`, `XX`, `GT`, and `LT` options are mutually exclusive. ``` redis> HSET mykey field1 "hello" field2 "world" -(integer 2) +(integer) 2 redis> HEXPIREAT mykey 1715704971 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 diff --git a/content/commands/hpersist.md b/content/commands/hpersist.md index 53cb87f32c..663ed38794 100644 --- a/content/commands/hpersist.md +++ b/content/commands/hpersist.md @@ -65,7 +65,7 @@ is associated). ``` redis> HSET mykey field1 "hello" field2 "world" -(integer 2) +(integer) 2 redis> HEXPIRE mykey 300 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 diff --git a/content/commands/hpexpire.md b/content/commands/hpexpire.md index 68001537d9..98e07713f7 100644 --- a/content/commands/hpexpire.md +++ b/content/commands/hpexpire.md @@ -101,7 +101,7 @@ The `NX`, `XX`, `GT`, and `LT` options are mutually exclusive. ``` redis> HSET mykey field1 "hello" field2 "world" -(integer 2) +(integer) 2 redis> HPEXPIRE mykey 2000 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 diff --git a/content/commands/hpexpireat.md b/content/commands/hpexpireat.md index 2d652f50c5..d8490f4107 100644 --- a/content/commands/hpexpireat.md +++ b/content/commands/hpexpireat.md @@ -102,7 +102,7 @@ The `NX`, `XX`, `GT`, and `LT` options are mutually exclusive. ``` redis> HSET mykey field1 "hello" field2 "world" -(integer 2) +(integer) 2 redis> HPEXPIREAT mykey 1715704971000 FIELDS 2 field1 field2 1) (integer) 1 2) (integer) 1 diff --git a/content/commands/info.md b/content/commands/info.md index 66d622c27f..3be798c1b3 100644 --- a/content/commands/info.md +++ b/content/commands/info.md @@ -622,7 +622,7 @@ It won't be included when `INFO` or `INFO ALL` are called, and it is returned on | Redis
Enterprise | Redis
Cloud | Notes | |:----------------------|:-----------------|:------| -| ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | +| ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | Note: key memory usage is different on Redis Software or Redis Cloud active-active databases than on non-active-active databases. This is because memory usage includes some amount of CRDB overhead. diff --git a/content/commands/memory-usage.md b/content/commands/memory-usage.md index aff92a98ac..24c5e0d0e8 100644 --- a/content/commands/memory-usage.md +++ b/content/commands/memory-usage.md @@ -92,7 +92,7 @@ OK | Redis
Enterprise | Redis
Cloud | Notes | |:----------------------|:-----------------|:------| -|✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +|✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | Note: key memory usage is different on Redis Software or Redis Cloud active-active databases than on non-active-active databases. This is because memory usage includes some amount of CRDB overhead. diff --git a/content/commands/psubscribe.md b/content/commands/psubscribe.md index e7856afd56..1794f6ae30 100644 --- a/content/commands/psubscribe.md +++ b/content/commands/psubscribe.md @@ -47,7 +47,7 @@ Use `\` to escape special characters if you want to match them verbatim. Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional [`SUBSCRIBE`]({{< relref "/commands/subscribe" >}}), [`SSUBSCRIBE`]({{< relref "/commands/ssubscribe" >}}), `PSUBSCRIBE`, [`UNSUBSCRIBE`]({{< relref "/commands/unsubscribe" >}}), [`SUNSUBSCRIBE`]({{< relref "/commands/sunsubscribe" >}}), [`PUNSUBSCRIBE`]({{< relref "/commands/punsubscribe" >}}), [`PING`]({{< relref "/commands/ping" >}}), [`RESET`]({{< relref "/commands/reset" >}}) and [`QUIT`]({{< relref "/commands/quit" >}}) commands. However, if RESP3 is used (see [`HELLO`]({{< relref "/commands/hello" >}})) it is possible for a client to issue any commands while in subscribed state. -For more information, see [Pub/sub]({{< relref "/develop/interact/pubsub" >}}). +For more information, see [Pub/sub]({{< relref "/develop/pubsub" >}}). ## Behavior change history diff --git a/content/commands/scan.md b/content/commands/scan.md index 335d525244..4387baaee2 100644 --- a/content/commands/scan.md +++ b/content/commands/scan.md @@ -286,7 +286,7 @@ Also note that this behavior is specific of [`SSCAN`]({{< relref "/commands/ssca ## Further reading -For more information about managing keys, please refer to the [The Redis Keyspace]({{< relref "/develop/use/keyspace" >}}) tutorial. +For more information about managing keys, please refer to the [The Redis Keyspace]({{< relref "/develop/using-commands/keyspace" >}}) tutorial. ## Additional examples diff --git a/content/commands/script-debug.md b/content/commands/script-debug.md index b380a33ad9..798ee97f35 100644 --- a/content/commands/script-debug.md +++ b/content/commands/script-debug.md @@ -47,7 +47,7 @@ complete Lua debugger, codename LDB, that can be used to make the task of writing complex scripts much simpler. In debug mode Redis acts as a remote debugging server and a client, such as `redis-cli`, can execute scripts step by step, set breakpoints, inspect variables and more - for additional information -about LDB refer to the [Redis Lua debugger]({{< relref "/develop/interact/programmability/lua-debugging" >}}) page. +about LDB refer to the [Redis Lua debugger]({{< relref "/develop/programmability/lua-debugging" >}}) page. **Important note:** avoid debugging Lua scripts using your Redis production server. Use a development server instead. @@ -63,7 +63,7 @@ is active and retains all changes to the data set once it ends. * `SYNC`. Enable blocking synchronous debugging of Lua scripts (saves changes to data). * `NO`. Disables scripts debug mode. -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Return information diff --git a/content/commands/script-exists.md b/content/commands/script-exists.md index cbf633c79f..ab5471211a 100644 --- a/content/commands/script-exists.md +++ b/content/commands/script-exists.md @@ -45,7 +45,7 @@ loaded (and if not, to load them using [`SCRIPT LOAD`]({{< relref "/commands/scr operation can be performed solely using [`EVALSHA`]({{< relref "/commands/evalsha" >}}) instead of [`EVAL`]({{< relref "/commands/eval" >}}) to save bandwidth. -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Return information diff --git a/content/commands/script-flush.md b/content/commands/script-flush.md index 31a1783a0e..873dcc2a4e 100644 --- a/content/commands/script-flush.md +++ b/content/commands/script-flush.md @@ -56,7 +56,7 @@ It is possible to use one of the following modifiers to dictate the flushing mod * `ASYNC`: flushes the cache asynchronously * `SYNC`: flushes the cache synchronously -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Behavior change history diff --git a/content/commands/script-kill.md b/content/commands/script-kill.md index 4b1473773c..03e7e40db6 100644 --- a/content/commands/script-kill.md +++ b/content/commands/script-kill.md @@ -44,7 +44,7 @@ In such a case, only `SHUTDOWN NOSAVE` can kill the script, killing the Redis process in a hard way and preventing it from persisting with half-written information. -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Return information diff --git a/content/commands/script-load.md b/content/commands/script-load.md index f7d3f65ba6..fb7fd1e30f 100644 --- a/content/commands/script-load.md +++ b/content/commands/script-load.md @@ -45,7 +45,7 @@ FLUSH` is called). The command works in the same way even if the script was already present in the script cache. -For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +For more information about [`EVAL`]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}). ## Return information diff --git a/content/commands/set.md b/content/commands/set.md index 1da2fe740b..74e0be5299 100644 --- a/content/commands/set.md +++ b/content/commands/set.md @@ -148,7 +148,7 @@ SET anotherkey "will expire in a minute" EX 60 ## Patterns -**Note:** The following pattern is discouraged in favor of [the Redlock algorithm]({{< relref "/develop/use/patterns/distributed-locks" >}}) which is only a bit more complex to implement, but offers better guarantees and is fault tolerant. +**Note:** The following pattern is discouraged in favor of [the Redlock algorithm]({{< relref "/develop/clients/patterns/distributed-locks" >}}) which is only a bit more complex to implement, but offers better guarantees and is fault tolerant. The command `SET resource-name anystring NX EX max-lock-time` is a simple way to implement a locking system with Redis. diff --git a/content/commands/setnx.md b/content/commands/setnx.md index 7bb9ce1e14..53f103b5b7 100644 --- a/content/commands/setnx.md +++ b/content/commands/setnx.md @@ -72,7 +72,7 @@ GET mykey **Please note that:** -1. The following pattern is discouraged in favor of [the Redlock algorithm]({{< relref "/develop/use/patterns/distributed-locks" >}}) which is only a bit more complex to implement, but offers better guarantees and is fault tolerant. +1. The following pattern is discouraged in favor of [the Redlock algorithm]({{< relref "/develop/clients/patterns/distributed-locks" >}}) which is only a bit more complex to implement, but offers better guarantees and is fault tolerant. 2. We document the old pattern anyway because certain existing implementations link to this page as a reference. Moreover it is an interesting example of how Redis commands can be used in order to mount programming primitives. 3. Anyway even assuming a single-instance locking primitive, starting with 2.6.12 it is possible to create a much simpler locking primitive, equivalent to the one discussed here, using the [`SET`]({{< relref "/commands/set" >}}) command to acquire the lock, and a simple Lua script to release the lock. The pattern is documented in the [`SET`]({{< relref "/commands/set" >}}) command page. diff --git a/content/commands/spublish.md b/content/commands/spublish.md index 700b964c91..db0fa3e493 100644 --- a/content/commands/spublish.md +++ b/content/commands/spublish.md @@ -55,7 +55,7 @@ In Redis Cluster, shard channels are assigned to slots by the same algorithm use A shard message must be sent to a node that owns the slot the shard channel is hashed to. The cluster makes sure that published shard messages are forwarded to all the nodes in the shard, so clients can subscribe to a shard channel by connecting to any one of the nodes in the shard. -For more information about sharded pubsub, see [Sharded Pubsub]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}). +For more information about sharded pubsub, see [Sharded Pubsub]({{< relref "/develop/pubsub#sharded-pubsub" >}}). ## Examples diff --git a/content/commands/ssubscribe.md b/content/commands/ssubscribe.md index 0a7b260263..71f0b0503b 100644 --- a/content/commands/ssubscribe.md +++ b/content/commands/ssubscribe.md @@ -53,7 +53,7 @@ Client(s) can subscribe to a node covering a slot (primary/replica) to receive t All the specified shard channels needs to belong to a single slot to subscribe in a given `SSUBSCRIBE` call, A client can subscribe to channels across different slots over separate `SSUBSCRIBE` call. -For more information about sharded Pub/Sub, see [Sharded Pub/Sub]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}). +For more information about sharded Pub/Sub, see [Sharded Pub/Sub]({{< relref "/develop/pubsub#sharded-pubsub" >}}). ## Examples diff --git a/content/commands/subscribe.md b/content/commands/subscribe.md index a57a0159da..1ea2aff7c0 100644 --- a/content/commands/subscribe.md +++ b/content/commands/subscribe.md @@ -41,7 +41,7 @@ other commands, except for additional `SUBSCRIBE`, [`SSUBSCRIBE`]({{< relref "/c [`PUNSUBSCRIBE`]({{< relref "/commands/punsubscribe" >}}), [`PING`]({{< relref "/commands/ping" >}}), [`RESET`]({{< relref "/commands/reset" >}}) and [`QUIT`]({{< relref "/commands/quit" >}}) commands. However, if RESP3 is used (see [`HELLO`]({{< relref "/commands/hello" >}})) it is possible for a client to issue any commands while in subscribed state. -For more information, see [Pub/sub]({{< relref "/develop/interact/pubsub" >}}). +For more information, see [Pub/sub]({{< relref "/develop/pubsub" >}}). ## Behavior change history diff --git a/content/commands/sunsubscribe.md b/content/commands/sunsubscribe.md index 1e7aeb34a3..d3696fd4bf 100644 --- a/content/commands/sunsubscribe.md +++ b/content/commands/sunsubscribe.md @@ -54,7 +54,7 @@ In this case a message for every unsubscribed shard channel will be sent to the Note: The global channels and shard channels needs to be unsubscribed from separately. -For more information about sharded Pub/Sub, see [Sharded Pub/Sub]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}). +For more information about sharded Pub/Sub, see [Sharded Pub/Sub]({{< relref "/develop/pubsub#sharded-pubsub" >}}). ## Return information diff --git a/content/develop/ai/_index.md b/content/develop/ai/_index.md index 486c764ae2..2be59d7591 100644 --- a/content/develop/ai/_index.md +++ b/content/develop/ai/_index.md @@ -15,7 +15,7 @@ Redis stores and indexes vector embeddings that semantically represent unstructu | Vector | RAG | RedisVL | | :-- | :-- | :-- | -| {{AI Redis icon.}}[Redis vector database quick start guide]({{< relref "/develop/get-started/vector-database" >}}) |{{AI Redis icon.}} [Retrieval-Augmented Generation quick start guide]({{< relref "/develop/get-started/rag" >}}) | {{AI Redis icon.}}[Redis vector Python client library documentation]({{< relref "/integrate/redisvl/" >}}) | +| {{AI Redis icon.}}[Redis vector database quick start guide]({{< relref "/develop/get-started/vector-database" >}}) |{{AI Redis icon.}} [Retrieval-Augmented Generation quick start guide]({{< relref "/develop/get-started/rag" >}}) | {{AI Redis icon.}}[Redis vector Python client library documentation]({{< relref "/develop/ai/redisvl/" >}}) | #### Overview diff --git a/content/develop/ai/ai-videos.md b/content/develop/ai/ai-videos.md index 103a5f903a..8b65f7601d 100644 --- a/content/develop/ai/ai-videos.md +++ b/content/develop/ai/ai-videos.md @@ -20,6 +20,8 @@ Explore our collection of video tutorials and demonstrations showcasing how Redi | What if you could skip redundant LLM calls and make your AI app faster, cheaper, and smarter? This video breaks down semantic caching and shows how it can transform your AI applications. | Unlock the Power of Retrieval-Augmented Generation (RAG) with RedisVL. This tutorial will show you how to build a complete RAG pipeline from scratch using Redis as your vector database. | Vector databases have been trending recently as they power modern search, recommendations, and AI-driven applications. Learn what vector databases are and how they work. | | [**Building the future Architecting AI Agents with AWS, LlamaIndex and Redis**](https://www.youtube.com/watch?v=SFWroqAbBM4) | [**Building AI Apps using LangChain**](https://www.youtube.com/watch?v=YhxksXfgsp0) | [**Resources to Learn AI with Redis**](https://www.youtube.com/watch?v=M_WU_fN_lrs) | | The ins and outs of AI agents: understand their role in breaking down tasks into manageable components for better performance. Learn how to architect AI agents using AWS, LlamaIndex, and Redis. | This series of videos dives into the integration between LangChain and Redis to power AI applications that need runtime speed, scalability, and intelligent data management. | This video shows which resources you can use to learn AI with Redis and build powerful AI applications. | +| [**What Is RAG? Retrieval-Augmented Generation Explained Simply**](https://www.youtube.com/watch?v=xPMQ2cVbUTI) | [**Chunking Strategies Explained**](https://www.youtube.com/watch?v=ZTOtxiWb2bE) | [**What is an embedding model?**](https://www.youtube.com/watch?v=0U1S0WSsPuE) | +| Retrieval-Augmented Generation (RAG) is one of the most powerful architectural patterns in GenAI today—combining the strengths of large language models (LLMs) with real-time, external context from your own data. In this session, learn why it matters and how each component—from query rewriting to dense retrieval to semantic chunking—works behind the scenes to power more accurate, grounded, and up-to-date responses. | Are you interested in building LLM applications that actually work? Your chunking strategy makes all the difference. In this video, get a break down of the science of text chunking so your embeddings can start answering the right questions to your users. | Everyone’s talking about embedding models lately—but what do they actually do, and why does it matter? This video breaks it down in simple terms and shows how embeddings power search, recommendations, and AI features behind the scenes. | ### Additional Resources diff --git a/content/develop/ai/redisvl/_index.md b/content/develop/ai/redisvl/_index.md new file mode 100644 index 0000000000..14950831c4 --- /dev/null +++ b/content/develop/ai/redisvl/_index.md @@ -0,0 +1,30 @@ +--- +categories: +- docs +- integrate +- stack +- oss +- rs +- rc +- oss +- clients +description: This is the Redis vector library (RedisVL). +group: library +hidden: false +linkTitle: RedisVL +summary: RedisVL provides a powerful, dedicated Python client library for using Redis + as a vector database. Leverage Redis's speed, reliability, and vector-based semantic + search capabilities to supercharge your application. +title: RedisVL +type: integration +weight: 1 +--- +RedisVL is a powerful, dedicated Python client library for Redis that enables seamless integration and management of high-dimensional vector data. +Built to support machine learning and artificial intelligence workflows, RedisVL simplifies the process of storing, searching, and analyzing vector embeddings, which are commonly used for tasks like recommendation systems, semantic search, and anomaly detection. + +Key features of RedisVL include: + +- Vector Similarity Search: Efficiently find nearest neighbors in high-dimensional spaces using algorithms like HNSW (Hierarchical Navigable Small World). +- Integration with AI Frameworks: RedisVL works seamlessly with popular frameworks such as TensorFlow, PyTorch, and Hugging Face, making it easy to deploy AI models. +- Scalable and Fast: Leveraging Redis's in-memory architecture, RedisVL provides low-latency access to vector data, even at scale. +- By bridging the gap between data storage and AI model deployment, RedisVL empowers developers to build intelligent, real-time applications with minimal infrastructure complexity. diff --git a/content/integrate/redisvl/api/_index.md b/content/develop/ai/redisvl/api/_index.md similarity index 98% rename from content/integrate/redisvl/api/_index.md rename to content/develop/ai/redisvl/api/_index.md index c52795d710..079e66ced5 100644 --- a/content/integrate/redisvl/api/_index.md +++ b/content/develop/ai/redisvl/api/_index.md @@ -1,9 +1,10 @@ --- linkTitle: RedisVL API title: RedisVL API -type: integration weight: 5 hideListLinks: true +aliases: +- /integrate/redisvl/api --- diff --git a/content/integrate/redisvl/api/cache.md b/content/develop/ai/redisvl/api/cache.md similarity index 99% rename from content/integrate/redisvl/api/cache.md rename to content/develop/ai/redisvl/api/cache.md index f9cecf6dc2..699ddacb6b 100644 --- a/content/integrate/redisvl/api/cache.md +++ b/content/develop/ai/redisvl/api/cache.md @@ -1,7 +1,8 @@ --- linkTitle: LLM cache title: LLM Cache -type: integration +aliases: +- /integrate/redisvl/api/cache --- diff --git a/content/integrate/redisvl/api/filter.md b/content/develop/ai/redisvl/api/filter.md similarity index 99% rename from content/integrate/redisvl/api/filter.md rename to content/develop/ai/redisvl/api/filter.md index 7281929929..b5cd683c2c 100644 --- a/content/integrate/redisvl/api/filter.md +++ b/content/develop/ai/redisvl/api/filter.md @@ -1,7 +1,8 @@ --- linkTitle: Filter title: Filter -type: integration +aliases: +- /integrate/redisvl/api/filter --- diff --git a/content/integrate/redisvl/api/message_history.md b/content/develop/ai/redisvl/api/message_history.md similarity index 99% rename from content/integrate/redisvl/api/message_history.md rename to content/develop/ai/redisvl/api/message_history.md index b07408a7e3..4c283d0081 100644 --- a/content/integrate/redisvl/api/message_history.md +++ b/content/develop/ai/redisvl/api/message_history.md @@ -1,7 +1,8 @@ --- linkTitle: LLM message history title: LLM Message History -type: integration +aliases: +- /integrate/redisvl/api/message_history --- diff --git a/content/integrate/redisvl/api/query.md b/content/develop/ai/redisvl/api/query.md similarity index 99% rename from content/integrate/redisvl/api/query.md rename to content/develop/ai/redisvl/api/query.md index 32f8f0780b..ec594f2f6e 100644 --- a/content/integrate/redisvl/api/query.md +++ b/content/develop/ai/redisvl/api/query.md @@ -1,7 +1,8 @@ --- linkTitle: Query title: Query -type: integration +aliases: +- /integrate/redisvl/api/query --- diff --git a/content/integrate/redisvl/api/reranker.md b/content/develop/ai/redisvl/api/reranker.md similarity index 99% rename from content/integrate/redisvl/api/reranker.md rename to content/develop/ai/redisvl/api/reranker.md index 11a40b5327..0eda469c1a 100644 --- a/content/integrate/redisvl/api/reranker.md +++ b/content/develop/ai/redisvl/api/reranker.md @@ -1,7 +1,8 @@ --- linkTitle: Rerankers title: Rerankers -type: integration +aliases: +- /integrate/redisvl/api/reranker --- diff --git a/content/integrate/redisvl/api/router.md b/content/develop/ai/redisvl/api/router.md similarity index 99% rename from content/integrate/redisvl/api/router.md rename to content/develop/ai/redisvl/api/router.md index b39639696b..12c67c3f88 100644 --- a/content/integrate/redisvl/api/router.md +++ b/content/develop/ai/redisvl/api/router.md @@ -1,7 +1,8 @@ --- linkTitle: Semantic router title: Semantic Router -type: integration +aliases: +- /integrate/redisvl/api/router --- diff --git a/content/integrate/redisvl/api/schema.md b/content/develop/ai/redisvl/api/schema.md similarity index 99% rename from content/integrate/redisvl/api/schema.md rename to content/develop/ai/redisvl/api/schema.md index 1e26cb69ec..cc7f43548f 100644 --- a/content/integrate/redisvl/api/schema.md +++ b/content/develop/ai/redisvl/api/schema.md @@ -1,7 +1,8 @@ --- linkTitle: Schema title: Schema -type: integration +aliases: +- /integrate/redisvl/api/schema --- diff --git a/content/integrate/redisvl/api/searchindex.md b/content/develop/ai/redisvl/api/searchindex.md similarity index 99% rename from content/integrate/redisvl/api/searchindex.md rename to content/develop/ai/redisvl/api/searchindex.md index d92838f364..5131230711 100644 --- a/content/integrate/redisvl/api/searchindex.md +++ b/content/develop/ai/redisvl/api/searchindex.md @@ -1,7 +1,8 @@ --- linkTitle: Search index classes title: Search Index Classes -type: integration +aliases: +- /integrate/redisvl/api/searchindex --- diff --git a/content/integrate/redisvl/api/session_manager.md b/content/develop/ai/redisvl/api/session_manager.md similarity index 99% rename from content/integrate/redisvl/api/session_manager.md rename to content/develop/ai/redisvl/api/session_manager.md index 6ea469eb69..8576f8bf77 100644 --- a/content/integrate/redisvl/api/session_manager.md +++ b/content/develop/ai/redisvl/api/session_manager.md @@ -1,7 +1,8 @@ --- linkTitle: LLM session manager title: LLM Session Manager -type: integration +aliases: +- /integrate/redisvl/api/session_manager --- diff --git a/content/integrate/redisvl/api/threshold_optimizer.md b/content/develop/ai/redisvl/api/threshold_optimizer.md similarity index 75% rename from content/integrate/redisvl/api/threshold_optimizer.md rename to content/develop/ai/redisvl/api/threshold_optimizer.md index bfdb463106..b5986ea115 100644 --- a/content/integrate/redisvl/api/threshold_optimizer.md +++ b/content/develop/ai/redisvl/api/threshold_optimizer.md @@ -1,7 +1,8 @@ --- linkTitle: Threshold optimizers title: Threshold Optimizers -type: integration +aliases: +- /integrate/redisvl/api/threshold_optimizer --- diff --git a/content/integrate/redisvl/api/vectorizer.md b/content/develop/ai/redisvl/api/vectorizer.md similarity index 99% rename from content/integrate/redisvl/api/vectorizer.md rename to content/develop/ai/redisvl/api/vectorizer.md index 7133911960..968ed88979 100644 --- a/content/integrate/redisvl/api/vectorizer.md +++ b/content/develop/ai/redisvl/api/vectorizer.md @@ -1,7 +1,8 @@ --- linkTitle: Vectorizers title: Vectorizers -type: integration +aliases: +- /integrate/redisvl/api/vectorizer --- diff --git a/content/integrate/redisvl/install.md b/content/develop/ai/redisvl/install.md similarity index 91% rename from content/integrate/redisvl/install.md rename to content/develop/ai/redisvl/install.md index 6c66c51858..9716fb1c87 100644 --- a/content/integrate/redisvl/install.md +++ b/content/develop/ai/redisvl/install.md @@ -1,11 +1,10 @@ --- -aliases: -- /integrate/redisvl/overview/install description: Install RedisVL linkTitle: Install title: Install -type: integration weight: 2 +aliases: +- /integrate/redisvl/install --- ## Installation diff --git a/content/integrate/redisvl/overview/_index.md b/content/develop/ai/redisvl/overview/_index.md similarity index 92% rename from content/integrate/redisvl/overview/_index.md rename to content/develop/ai/redisvl/overview/_index.md index 602ca30ff3..ebfdcbdbd3 100644 --- a/content/integrate/redisvl/overview/_index.md +++ b/content/develop/ai/redisvl/overview/_index.md @@ -1,9 +1,10 @@ --- linkTitle: Overview title: Overview -type: integration weight: 3 hideListLinks: true +aliases: +- /integrate/redisvl/overview --- diff --git a/content/integrate/redisvl/overview/cli.md b/content/develop/ai/redisvl/overview/cli.md similarity index 99% rename from content/integrate/redisvl/overview/cli.md rename to content/develop/ai/redisvl/overview/cli.md index 123b78986f..c0a5005128 100644 --- a/content/integrate/redisvl/overview/cli.md +++ b/content/develop/ai/redisvl/overview/cli.md @@ -1,7 +1,8 @@ --- linkTitle: The RedisVL CLI title: The RedisVL CLI -type: integration +aliases: +- /integrate/redisvl/overview/cli --- diff --git a/content/integrate/redisvl/overview/installation.md b/content/develop/ai/redisvl/overview/installation.md similarity index 98% rename from content/integrate/redisvl/overview/installation.md rename to content/develop/ai/redisvl/overview/installation.md index 271d294c3a..3472743483 100644 --- a/content/integrate/redisvl/overview/installation.md +++ b/content/develop/ai/redisvl/overview/installation.md @@ -1,7 +1,8 @@ --- linkTitle: Install RedisVL title: Install RedisVL -type: integration +aliases: +- /integrate/redisvl/overview/installation --- diff --git a/content/integrate/redisvl/user_guide/_index.md b/content/develop/ai/redisvl/user_guide/_index.md similarity index 99% rename from content/integrate/redisvl/user_guide/_index.md rename to content/develop/ai/redisvl/user_guide/_index.md index 61f0ea04af..fe7fd536d0 100644 --- a/content/integrate/redisvl/user_guide/_index.md +++ b/content/develop/ai/redisvl/user_guide/_index.md @@ -1,9 +1,10 @@ --- linkTitle: User guides title: User Guides -type: integration weight: 4 hideListLinks: true +aliases: +- /integrate/redisvl/user_guide --- diff --git a/content/integrate/redisvl/user_guide/embeddings_cache.md b/content/develop/ai/redisvl/user_guide/embeddings_cache.md similarity index 99% rename from content/integrate/redisvl/user_guide/embeddings_cache.md rename to content/develop/ai/redisvl/user_guide/embeddings_cache.md index 731dba6588..2271e63e08 100644 --- a/content/integrate/redisvl/user_guide/embeddings_cache.md +++ b/content/develop/ai/redisvl/user_guide/embeddings_cache.md @@ -1,8 +1,9 @@ --- linkTitle: Caching embeddings title: Caching Embeddings -type: integration weight: 10 +aliases: +- /integrate/redisvl/user_guide/embeddings_cache --- diff --git a/content/integrate/redisvl/user_guide/getting_started.md b/content/develop/ai/redisvl/user_guide/getting_started.md similarity index 99% rename from content/integrate/redisvl/user_guide/getting_started.md rename to content/develop/ai/redisvl/user_guide/getting_started.md index bd9f294c86..ef82f4b789 100644 --- a/content/integrate/redisvl/user_guide/getting_started.md +++ b/content/develop/ai/redisvl/user_guide/getting_started.md @@ -1,8 +1,9 @@ --- linkTitle: Getting started with RedisVL title: Getting Started with RedisVL -type: integration weight: 01 +aliases: +- /integrate/redisvl/user_guide/getting_started --- `redisvl` is a versatile Python library with an integrated CLI, designed to enhance AI applications using Redis. This guide will walk you through the following steps: diff --git a/content/integrate/redisvl/user_guide/hash_vs_json.md b/content/develop/ai/redisvl/user_guide/hash_vs_json.md similarity index 99% rename from content/integrate/redisvl/user_guide/hash_vs_json.md rename to content/develop/ai/redisvl/user_guide/hash_vs_json.md index b141ffe93c..879c858572 100644 --- a/content/integrate/redisvl/user_guide/hash_vs_json.md +++ b/content/develop/ai/redisvl/user_guide/hash_vs_json.md @@ -1,8 +1,9 @@ --- linkTitle: Hash vs JSON storage title: Hash vs JSON Storage -type: integration weight: 05 +aliases: +- /integrate/redisvl/user_guide/hash_vs_json --- diff --git a/content/integrate/redisvl/user_guide/hybrid_queries.md b/content/develop/ai/redisvl/user_guide/hybrid_queries.md similarity index 99% rename from content/integrate/redisvl/user_guide/hybrid_queries.md rename to content/develop/ai/redisvl/user_guide/hybrid_queries.md index 8b9a1d557a..1f45e5b349 100644 --- a/content/integrate/redisvl/user_guide/hybrid_queries.md +++ b/content/develop/ai/redisvl/user_guide/hybrid_queries.md @@ -1,8 +1,9 @@ --- linkTitle: Querying with RedisVL title: Querying with RedisVL -type: integration weight: 02 +aliases: +- /integrate/redisvl/user_guide/hybrid_queries --- diff --git a/content/integrate/redisvl/user_guide/llmcache.md b/content/develop/ai/redisvl/user_guide/llmcache.md similarity index 99% rename from content/integrate/redisvl/user_guide/llmcache.md rename to content/develop/ai/redisvl/user_guide/llmcache.md index bc98756950..f2d32a9c26 100644 --- a/content/integrate/redisvl/user_guide/llmcache.md +++ b/content/develop/ai/redisvl/user_guide/llmcache.md @@ -1,8 +1,9 @@ --- linkTitle: Semantic caching for LLMs title: Semantic Caching for LLMs -type: integration weight: 03 +aliases: +- /integrate/redisvl/user_guide/llmcache --- diff --git a/content/integrate/redisvl/user_guide/message_history.md b/content/develop/ai/redisvl/user_guide/message_history.md similarity index 99% rename from content/integrate/redisvl/user_guide/message_history.md rename to content/develop/ai/redisvl/user_guide/message_history.md index 61a4628034..0e84bd8deb 100644 --- a/content/integrate/redisvl/user_guide/message_history.md +++ b/content/develop/ai/redisvl/user_guide/message_history.md @@ -1,8 +1,9 @@ --- linkTitle: LLM message history title: LLM Message History -type: integration weight: 07 +aliases: +- /integrate/redisvl/user_guide/message_history --- diff --git a/content/integrate/redisvl/user_guide/release_guide/0_5_0_release.md b/content/develop/ai/redisvl/user_guide/release_guide/0_5_0_release.md similarity index 99% rename from content/integrate/redisvl/user_guide/release_guide/0_5_0_release.md rename to content/develop/ai/redisvl/user_guide/release_guide/0_5_0_release.md index 4e5c0bfdd9..0711737a49 100644 --- a/content/integrate/redisvl/user_guide/release_guide/0_5_0_release.md +++ b/content/develop/ai/redisvl/user_guide/release_guide/0_5_0_release.md @@ -1,7 +1,8 @@ --- linkTitle: 0.5.1 feature overview title: 0.5.1 Feature Overview -type: integration +aliases: +- /integrate/redisvl/user_guide/release_guide/0_5_0_release --- diff --git a/content/integrate/redisvl/user_guide/release_guide/_index.md b/content/develop/ai/redisvl/user_guide/release_guide/_index.md similarity index 93% rename from content/integrate/redisvl/user_guide/release_guide/_index.md rename to content/develop/ai/redisvl/user_guide/release_guide/_index.md index 4b8a392d55..32a679d3bd 100644 --- a/content/integrate/redisvl/user_guide/release_guide/_index.md +++ b/content/develop/ai/redisvl/user_guide/release_guide/_index.md @@ -1,8 +1,9 @@ --- linkTitle: Release guides title: Release Guides -type: integration hideListLinks: true +aliases: +- /integrate/redisvl/user_guide/release_guide --- diff --git a/content/integrate/redisvl/user_guide/rerankers.md b/content/develop/ai/redisvl/user_guide/rerankers.md similarity index 99% rename from content/integrate/redisvl/user_guide/rerankers.md rename to content/develop/ai/redisvl/user_guide/rerankers.md index 5747a0078c..9ec9c94a77 100644 --- a/content/integrate/redisvl/user_guide/rerankers.md +++ b/content/develop/ai/redisvl/user_guide/rerankers.md @@ -1,8 +1,9 @@ --- linkTitle: Rerankers title: Rerankers -type: integration weight: 06 +aliases: +- /integrate/redisvl/user_guide/rerankers --- diff --git a/content/integrate/redisvl/user_guide/semantic_router.md b/content/develop/ai/redisvl/user_guide/semantic_router.md similarity index 99% rename from content/integrate/redisvl/user_guide/semantic_router.md rename to content/develop/ai/redisvl/user_guide/semantic_router.md index 74ea12c04e..e6358e99b7 100644 --- a/content/integrate/redisvl/user_guide/semantic_router.md +++ b/content/develop/ai/redisvl/user_guide/semantic_router.md @@ -1,8 +1,9 @@ --- linkTitle: Semantic routing title: Semantic Routing -type: integration weight: 08 +aliases: +- /integrate/redisvl/user_guide/semantic_router --- diff --git a/content/integrate/redisvl/user_guide/session_manager.md b/content/develop/ai/redisvl/user_guide/session_manager.md similarity index 99% rename from content/integrate/redisvl/user_guide/session_manager.md rename to content/develop/ai/redisvl/user_guide/session_manager.md index 57eac77620..18d1cbea86 100644 --- a/content/integrate/redisvl/user_guide/session_manager.md +++ b/content/develop/ai/redisvl/user_guide/session_manager.md @@ -1,8 +1,9 @@ --- linkTitle: LLM session memory title: LLM Session Memory -type: integration weight: 07 +aliases: +- /integrate/redisvl/user_guide/session_manager --- diff --git a/content/integrate/redisvl/user_guide/threshold_optimization.md b/content/develop/ai/redisvl/user_guide/threshold_optimization.md similarity index 99% rename from content/integrate/redisvl/user_guide/threshold_optimization.md rename to content/develop/ai/redisvl/user_guide/threshold_optimization.md index 43722609ef..e870aa037a 100644 --- a/content/integrate/redisvl/user_guide/threshold_optimization.md +++ b/content/develop/ai/redisvl/user_guide/threshold_optimization.md @@ -1,8 +1,9 @@ --- linkTitle: Threshold optimization title: Threshold Optimization -type: integration weight: 09 +aliases: +- /integrate/redisvl/user_guide/threshold_optimization --- diff --git a/content/integrate/redisvl/user_guide/vectorizers.md b/content/develop/ai/redisvl/user_guide/vectorizers.md similarity index 99% rename from content/integrate/redisvl/user_guide/vectorizers.md rename to content/develop/ai/redisvl/user_guide/vectorizers.md index b50689c024..8eb2cf38c3 100644 --- a/content/integrate/redisvl/user_guide/vectorizers.md +++ b/content/develop/ai/redisvl/user_guide/vectorizers.md @@ -1,8 +1,9 @@ --- linkTitle: Vectorizers title: Vectorizers -type: integration weight: 04 +aliases: +- /integrate/redisvl/user_guide/vectorizers --- diff --git a/content/develop/ai/search-and-query/_index.md b/content/develop/ai/search-and-query/_index.md index 4d2db51268..4f4824570c 100644 --- a/content/develop/ai/search-and-query/_index.md +++ b/content/develop/ai/search-and-query/_index.md @@ -1,6 +1,7 @@ --- aliases: - /develop/interact/search-and-query +- /develop/interact/search-and-query/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/administration/_index.md b/content/develop/ai/search-and-query/administration/_index.md index 9fa18c6f85..040bd0eed7 100644 --- a/content/develop/ai/search-and-query/administration/_index.md +++ b/content/develop/ai/search-and-query/administration/_index.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/interact/search-and-query/administration/_index +- /develop/interact/search-and-query/administration +- /develop/interact/search-and-query/administration/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/administration/configuration.md b/content/develop/ai/search-and-query/administration/configuration.md index 9b25aed3b2..7b2e0abd2b 100644 --- a/content/develop/ai/search-and-query/administration/configuration.md +++ b/content/develop/ai/search-and-query/administration/configuration.md @@ -1,5 +1,7 @@ --- -aliases: /develop/ai/search-and-query/basic-constructs/configuration-parameters +aliases: +- /develop/interact/search-and-query/administration/configuration +- /develop/interact/search-and-query/basic-constructs/configuration-parameters categories: - docs - develop diff --git a/content/develop/ai/search-and-query/advanced-concepts/_index.md b/content/develop/ai/search-and-query/advanced-concepts/_index.md index 166217b290..ff9f0be5c3 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/_index.md +++ b/content/develop/ai/search-and-query/advanced-concepts/_index.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/interact/search-and-query/advanced-concepts/_index +- /develop/interact/search-and-query/advanced-concepts +- /develop/interact/search-and-query/advanced-concepts/ categories: - docs - develop @@ -42,6 +43,7 @@ Redis Open Source supports the following Redis Query Engine features. This artic * Numeric filters and ranges * Geo-filtering using Redis [geo commands]({{< relref "/commands/" >}}?group=geo) * [Vector search]({{< relref "/develop/ai/search-and-query/vectors" >}}) +* [Key and field expiration behavior]({{< relref "/develop/ai/search-and-query/advanced-concepts/expiration" >}}) ## Full-text search features diff --git a/content/develop/ai/search-and-query/advanced-concepts/autocomplete.md b/content/develop/ai/search-and-query/advanced-concepts/autocomplete.md index 2eaafca312..2d5cd13057 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/autocomplete.md +++ b/content/develop/ai/search-and-query/advanced-concepts/autocomplete.md @@ -111,7 +111,7 @@ To remove a specific suggestion from the dictionary, use the `FT.SUGDEL` command ``` redis> FT.SUGDEL autocomplete "help me" -(integer 1) +(integer) 1 ``` After deletion, running `FT.SUGGET autocomplete hell FUZZY` will no longer return "help me". diff --git a/content/develop/ai/search-and-query/advanced-concepts/expiration.md b/content/develop/ai/search-and-query/advanced-concepts/expiration.md new file mode 100644 index 0000000000..1e537d514d --- /dev/null +++ b/content/develop/ai/search-and-query/advanced-concepts/expiration.md @@ -0,0 +1,79 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: How the Redis Query Engine handles expiring keys and hash fields +linkTitle: Key and field expiration +title: Key and field expiration behavior +weight: 8 +--- + +The Redis Query Engine behavior with expiring keys and hash fields has been enhanced starting with Redis 8 to provide more consistent and predictable results. + +## Key expiration + +### Expiration times + +**Before Redis 8**: Expiration times were not taken into account when computing the result set. + +**Redis 8 and later**: The query engine returns only documents that are valid (not expired) at the time when the query or cursor read started. + +### Active expiration + +Active expiration can affect the number of results returned. For example, if a user requests 100 documents but 10 are actively expired during query execution, only 90 documents will be returned. + +**Note**: This behavior did not change in Redis 8 - active expiration has always affected result counts. + +### Passive expiration + +**Before Redis 8**: A query could return `nil` as a document name in the result set for a key that was passively expired. + +**Redis 8 and later**: Only valid document names will be returned. Passively expired keys are filtered out from the result set. + +## Field expiration + +Field expiration was introduced in Redis 7.4 and provides fine-grained control over hash field lifecycles. + +### Expiration times + +**Before Redis 8**: Field expiration times were not taken into account when computing the result set. + +**Redis 8 and later**: The query engine returns only documents that are valid (fields not expired) at the time when the query or cursor read started. + +### Active expiration + +Similar to key expiration, active field expiration can affect the number of results returned. If fields that match query criteria are actively expired during execution, fewer results will be returned than requested. + +**Note**: This behavior did not change in Redis 8 - active expiration has always affected result counts. + +### Passive expiration + +**Before Redis 8**: The query engine could return documents without fields that were passively expired, even if the expired field caused the document to match the query. This behavior depended to some degree on the `SORTABLE` keyword usage. + +**Redis 8 and later**: Documents will return with all fields that existed when the query or cursor read started. Passively expired fields are handled consistently. + +## Best practices + +* **Consistent timing**: Be aware that query results are based on the state at query start time, not when individual documents are processed. + +* **Result count expectations**: Be aware that when you use expiring keys or fields, the actual number of results may be less than you expected due to active expiration during the execution of the query. + +* **Field-level expiration**: Use hash field expiration (available since Redis 7.4) for fine-grained control over document field lifecycles without affecting the entire document. + +* **Query planning**: Consider expiration patterns when designing queries, especially for time-sensitive applications where expired data should not appear in results. + +## Related commands + +The following commands are directly related to key and field expiration: + +- [`EXPIRE`]({{< relref "/commands/expire" >}}) - Set expiration time for keys +- [`HEXPIRE`]({{< relref "/commands/hexpire" >}}) - Set expiration time for hash fields +- [`FT.SEARCH`]({{< relref "/commands/ft.search" >}}) - Search queries affected by expiration behavior +- [`FT.AGGREGATE`]({{< relref "/commands/ft.aggregate" >}}) - Aggregation queries affected by expiration behavior diff --git a/content/develop/ai/search-and-query/best-practices/_index.md b/content/develop/ai/search-and-query/best-practices/_index.md index 58c602292c..0e59e70dc3 100644 --- a/content/develop/ai/search-and-query/best-practices/_index.md +++ b/content/develop/ai/search-and-query/best-practices/_index.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/interact/search-and-query/best-practices/_index +- /develop/interact/search-and-query/best-practices +- /develop/interact/search-and-query/best-practices/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/best-practices/index-mgmt-best-practices.md b/content/develop/ai/search-and-query/best-practices/index-mgmt-best-practices.md index 4280aa4a26..ef57824fbb 100644 --- a/content/develop/ai/search-and-query/best-practices/index-mgmt-best-practices.md +++ b/content/develop/ai/search-and-query/best-practices/index-mgmt-best-practices.md @@ -1,4 +1,6 @@ --- +aliases: +- /develop/interact/search-and-query/best-practices/index-mgmt-best-practices Title: Index management best practices for Redis Query Engine alwaysopen: false categories: @@ -150,7 +152,7 @@ Monitoring and troubleshooting aliases: ## Index maintenance - If schema changes are required, create a new index with the updated schema and reassign the alias once the index is ready. -- Use [Redis key expiration]({{< relref "/develop/use/keyspace#key-expiration" >}}) to automatically remove outdated records and keep indexes lean. +- Use [Redis key expiration]({{< relref "/develop/using-commands/keyspace#key-expiration" >}}) to automatically remove outdated records and keep indexes lean. ### FT.ALTER vs. aliasing diff --git a/content/develop/ai/search-and-query/deprecated/_index.md b/content/develop/ai/search-and-query/deprecated/_index.md index 9ee0a8fa87..ef60918d5d 100644 --- a/content/develop/ai/search-and-query/deprecated/_index.md +++ b/content/develop/ai/search-and-query/deprecated/_index.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/interact/search-and-query/deprecated/_index +- /develop/interact/search-and-query/deprecated +- /develop/interact/search-and-query/deprecated/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/indexing/_index.md b/content/develop/ai/search-and-query/indexing/_index.md index caf1c38a2a..1162e9a796 100644 --- a/content/develop/ai/search-and-query/indexing/_index.md +++ b/content/develop/ai/search-and-query/indexing/_index.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/interact/search-and-query/indexing/_index +- /develop/interact/search-and-query/indexing +- /develop/interact/search-and-query/indexing/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/indexing/field-and-type-options.md b/content/develop/ai/search-and-query/indexing/field-and-type-options.md index 3940a1912d..cb2033f2be 100644 --- a/content/develop/ai/search-and-query/indexing/field-and-type-options.md +++ b/content/develop/ai/search-and-query/indexing/field-and-type-options.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/ai/search-and-query/basic-constructs/field-and-type-options +- /develop/interact/search-and-query/indexing/field-and-type-options +- /develop/interact/search-and-query/basic-constructs/field-and-type-options categories: - docs - develop diff --git a/content/develop/ai/search-and-query/indexing/schema-definition.md b/content/develop/ai/search-and-query/indexing/schema-definition.md index 68cbc69667..c2b3baf2a0 100644 --- a/content/develop/ai/search-and-query/indexing/schema-definition.md +++ b/content/develop/ai/search-and-query/indexing/schema-definition.md @@ -1,6 +1,7 @@ --- aliases: -- /develop/ai/search-and-query/basic-constructs/schema-definition +- /develop/interact/search-and-query/indexing/schema-definition +- /develop/interact/search-and-query/basic-constructs/schema-definition categories: - docs - develop diff --git a/content/develop/ai/search-and-query/query/_index.md b/content/develop/ai/search-and-query/query/_index.md index f7ccd95806..94a80b3157 100644 --- a/content/develop/ai/search-and-query/query/_index.md +++ b/content/develop/ai/search-and-query/query/_index.md @@ -1,4 +1,7 @@ --- +aliases: +- /develop/interact/search-and-query/query +- /develop/interact/search-and-query/query/ categories: - docs - develop diff --git a/content/develop/ai/search-and-query/vectors.md b/content/develop/ai/search-and-query/vectors.md index f4f27c60a5..0c9a590368 100644 --- a/content/develop/ai/search-and-query/vectors.md +++ b/content/develop/ai/search-and-query/vectors.md @@ -1,6 +1,6 @@ --- aliases: -- /develop/ai/search-and-query/advanced-concepts/vectors +- /develop/interact/search-and-query/advanced-concepts/vectors categories: - docs - develop diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 6afaff0764..766df68ad4 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -24,7 +24,7 @@ for seven main languages: | Language | Client name | Docs | Supported | | :-- | :-- | :-- | :-- | | [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[`redis-py` guide]({{< relref "/develop/clients/redis-py" >}}) | Yes | -| [Python](https://www.python.org/) | [`RedisVL`](https://github.com/redis/redis-vl-python) |[RedisVL guide]({{< relref "/integrate/redisvl" >}}) | Yes +| [Python](https://www.python.org/) | [`RedisVL`](https://github.com/redis/redis-vl-python) |[RedisVL guide]({{< relref "/develop/ai/redisvl" >}}) | Yes | [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[`NRedisStack` guide]({{< relref "/develop/clients/dotnet" >}}) | Yes | | [JavaScript](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [`node-redis` guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | | [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [`Jedis` guide]({{< relref "/develop/clients/jedis" >}}) | Yes | diff --git a/content/develop/clients/dotnet/condexec.md b/content/develop/clients/dotnet/condexec.md index f08d602bf5..f601e06ce1 100644 --- a/content/develop/clients/dotnet/condexec.md +++ b/content/develop/clients/dotnet/condexec.md @@ -17,7 +17,7 @@ weight: 60 Most Redis client libraries use transactions with the [`WATCH`]({{< relref "/commands/watch" >}}) command as the main way to prevent -two clients writing to the same key at once (see [Transactions]({{< relref "/develop/interact/transactions" >}}) for more information). Unfortunately, this approach is +two clients writing to the same key at once (see [Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information). Unfortunately, this approach is difficult to use explicitly in `NRedisStack`. Its [multiplexing]({{< relref "/develop/clients/pools-and-muxing" >}}) system is highly efficient and convenient but can also cause bad interactions diff --git a/content/develop/clients/dotnet/transpipe.md b/content/develop/clients/dotnet/transpipe.md index bfb44e4421..65e2d5e875 100644 --- a/content/develop/clients/dotnet/transpipe.md +++ b/content/develop/clients/dotnet/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -57,7 +57,7 @@ to different keys. The basic idea is to watch for changes to any keys that you use in a transaction while you are are processing the updates. If the watched keys do change, you must restart the updates with the latest data from the keys. See -[Transactions]({{< relref "/develop/interact/transactions" >}}) +[Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information about optimistic locking. The approach to optimistic locking that other clients use diff --git a/content/develop/clients/go/transpipe.md b/content/develop/clients/go/transpipe.md index f22e401501..ee001456fa 100644 --- a/content/develop/clients/go/transpipe.md +++ b/content/develop/clients/go/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -77,7 +77,7 @@ to different keys. The basic idea is to watch for changes to any keys that you use in a transaction while you are are processing the updates. If the watched keys do change, you must restart the updates with the latest data from the keys. See -[Transactions]({{< relref "/develop/interact/transactions" >}}) +[Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information about optimistic locking. The code below reads a string diff --git a/content/develop/clients/hiredis/transpipe.md b/content/develop/clients/hiredis/transpipe.md index b50b417ce9..abd228dcc0 100644 --- a/content/develop/clients/hiredis/transpipe.md +++ b/content/develop/clients/hiredis/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -109,5 +109,5 @@ when you have finished processing it, as in the example above. you can implement them yourself using the [`MULTI`]({{< relref "/commands/multi" >}}), [`EXEC`]({{< relref "/commands/exec" >}}), and [`WATCH`]({{< relref "/commands/watch" >}}) commands as you would from [`redis-cli`]({{< relref "/develop/tools/cli" >}}). -See [Transactions]({{< relref "/develop/interact/transactions" >}}) +See [Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information. diff --git a/content/develop/clients/jedis/transpipe.md b/content/develop/clients/jedis/transpipe.md index d26b595f92..4c40cc9582 100644 --- a/content/develop/clients/jedis/transpipe.md +++ b/content/develop/clients/jedis/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -68,7 +68,7 @@ to different keys. The basic idea is to watch for changes to any keys that you use in a transaction while you are are processing the updates. If the watched keys do change, you must restart the updates with the latest data from the keys. See -[Transactions]({{< relref "/develop/interact/transactions" >}}) +[Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information about optimistic locking. The code below reads a string diff --git a/content/develop/clients/nodejs/amr.md b/content/develop/clients/nodejs/amr.md index 8a034b9492..99ac088b6a 100644 --- a/content/develop/clients/nodejs/amr.md +++ b/content/develop/clients/nodejs/amr.md @@ -340,7 +340,7 @@ console.log(`Database size is ${size}`); If you are using the [RESP2]({{< relref "/develop/reference/protocol-spec#resp-versions" >}}) protocol, you should -be aware that [pub/sub]({{< relref "/develop/interact/pubsub" >}}) can +be aware that [pub/sub]({{< relref "/develop/pubsub" >}}) can cause complications with reauthentication. After a connection enters PUB/SUB mode, the socket is blocked and can't process diff --git a/content/develop/clients/nodejs/connect.md b/content/develop/clients/nodejs/connect.md index 1f8a26bc62..9092c0eeb6 100644 --- a/content/develop/clients/nodejs/connect.md +++ b/content/develop/clients/nodejs/connect.md @@ -344,7 +344,7 @@ related to connection: - `reconnecting`: (No parameters) The client is about to try reconnecting after the connection was lost due to an error. - `sharded-channel-moved`: The cluster slot of a subscribed - [sharded pub/sub channel]({{< relref "/develop/interact/pubsub#sharded-pubsub" >}}) + [sharded pub/sub channel]({{< relref "/develop/pubsub#sharded-pubsub" >}}) has been moved to another shard. Note that when you use a [`RedisCluster`](#connect-to-a-redis-cluster) connection, this event is automatically handled for you. See diff --git a/content/develop/clients/nodejs/migration.md b/content/develop/clients/nodejs/migration.md index a0f36f1eab..110da9289a 100644 --- a/content/develop/clients/nodejs/migration.md +++ b/content/develop/clients/nodejs/migration.md @@ -321,7 +321,7 @@ for await (const keys of client.scanIterator()) { `ioredis` reports incoming pub/sub messages with a `message` event on the client object (see -[Publish/subscribe]({{< relref "/develop/interact/pubsub" >}}) for more +[Publish/subscribe]({{< relref "/develop/pubsub" >}}) for more information about messages): ```js diff --git a/content/develop/clients/nodejs/transpipe.md b/content/develop/clients/nodejs/transpipe.md index b396ddca98..584090cdf3 100644 --- a/content/develop/clients/nodejs/transpipe.md +++ b/content/develop/clients/nodejs/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -112,7 +112,7 @@ to different keys. The basic idea is to watch for changes to any keys that you use in a transaction while you are are processing the updates. If the watched keys do change, you must restart the updates with the latest data from the keys. See -[Transactions]({{< relref "/develop/interact/transactions" >}}) +[Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information about optimistic locking. The code below reads a string diff --git a/content/develop/use/patterns/_index.md b/content/develop/clients/patterns/_index.md similarity index 72% rename from content/develop/use/patterns/_index.md rename to content/develop/clients/patterns/_index.md index 714a33b1c3..d640b4ca70 100644 --- a/content/develop/use/patterns/_index.md +++ b/content/develop/clients/patterns/_index.md @@ -10,9 +10,10 @@ categories: - kubernetes - clients description: Novel patterns for working with Redis data structures -linkTitle: Patterns -title: Redis programming patterns -weight: 6 +linkTitle: Coding patterns +title: Coding patterns +aliases: /develop/use/patterns +weight: 50 --- The following documents describe some novel development patterns you can use with Redis. diff --git a/content/develop/use/patterns/bulk-loading.md b/content/develop/clients/patterns/bulk-loading.md similarity index 99% rename from content/develop/use/patterns/bulk-loading.md rename to content/develop/clients/patterns/bulk-loading.md index d37de3ef08..92c0f532b7 100644 --- a/content/develop/use/patterns/bulk-loading.md +++ b/content/develop/clients/patterns/bulk-loading.md @@ -14,6 +14,7 @@ description: 'Writing data in bulk using the Redis protocol ' linkTitle: Bulk loading title: Bulk loading +aliases: /develop/use/patterns/bulk-loading weight: 1 --- diff --git a/content/develop/use/patterns/distributed-locks.md b/content/develop/clients/patterns/distributed-locks.md similarity index 99% rename from content/develop/use/patterns/distributed-locks.md rename to content/develop/clients/patterns/distributed-locks.md index e7c0ae9e54..f51467a208 100644 --- a/content/develop/use/patterns/distributed-locks.md +++ b/content/develop/clients/patterns/distributed-locks.md @@ -14,6 +14,7 @@ description: 'A distributed lock pattern with Redis ' linkTitle: Distributed locks title: Distributed Locks with Redis +aliases: /develop/use/patterns/distributed-locks weight: 1 --- Distributed locks are a very useful primitive in many environments where diff --git a/content/develop/use/patterns/indexes/2idx_0.png b/content/develop/clients/patterns/indexes/2idx_0.png similarity index 100% rename from content/develop/use/patterns/indexes/2idx_0.png rename to content/develop/clients/patterns/indexes/2idx_0.png diff --git a/content/develop/use/patterns/indexes/2idx_1.png b/content/develop/clients/patterns/indexes/2idx_1.png similarity index 100% rename from content/develop/use/patterns/indexes/2idx_1.png rename to content/develop/clients/patterns/indexes/2idx_1.png diff --git a/content/develop/use/patterns/indexes/2idx_2.png b/content/develop/clients/patterns/indexes/2idx_2.png similarity index 100% rename from content/develop/use/patterns/indexes/2idx_2.png rename to content/develop/clients/patterns/indexes/2idx_2.png diff --git a/content/develop/use/patterns/indexes/index.md b/content/develop/clients/patterns/indexes/index.md similarity index 100% rename from content/develop/use/patterns/indexes/index.md rename to content/develop/clients/patterns/indexes/index.md diff --git a/content/develop/use/patterns/twitter-clone.md b/content/develop/clients/patterns/twitter-clone.md similarity index 99% rename from content/develop/use/patterns/twitter-clone.md rename to content/develop/clients/patterns/twitter-clone.md index 708f3997b0..7dfb6853db 100644 --- a/content/develop/use/patterns/twitter-clone.md +++ b/content/develop/clients/patterns/twitter-clone.md @@ -12,6 +12,7 @@ categories: description: Learn several Redis patterns by building a Twitter clone linkTitle: Patterns example title: Redis patterns example +aliases: /develop/use/patterns/twitter-clone weight: 20 --- diff --git a/content/develop/clients/pools-and-muxing.md b/content/develop/clients/pools-and-muxing.md index b172abccf2..821b76f3c4 100644 --- a/content/develop/clients/pools-and-muxing.md +++ b/content/develop/clients/pools-and-muxing.md @@ -71,7 +71,7 @@ used to identify where to send the response data from your commands. Note that it is not a problem if the multiplexer receives several commands close together in time. When this happens, the multiplexer can often combine the commands into a -[pipeline]({{< relref "/develop/use/pipelining" >}}), which +[pipeline]({{< relref "/develop/using-commands/pipelining" >}}), which improves efficiency. Multiplexing offers high efficiency but works transparently without requiring diff --git a/content/develop/clients/redis-py/transpipe.md b/content/develop/clients/redis-py/transpipe.md index ebd9a87a28..78093f86d1 100644 --- a/content/develop/clients/redis-py/transpipe.md +++ b/content/develop/clients/redis-py/transpipe.md @@ -21,11 +21,11 @@ There are two types of batch that you can use: - **Pipelines** avoid network and processing overhead by sending several commands to the server together in a single communication. The server then sends back a single communication with all the responses. See the - [Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more + [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) page for more information. - **Transactions** guarantee that all the included commands will execute to completion without being interrupted by commands from other clients. - See the [Transactions]({{< relref "/develop/interact/transactions" >}}) + See the [Transactions]({{< relref "develop/using-commands/transactions" >}}) page for more information. ## Execute a pipeline @@ -62,7 +62,7 @@ to different keys. The basic idea is to watch for changes to any keys that you use in a transaction while you are processing the updates. If the watched keys do change, you must restart the updates with the latest data from the keys. See -[Transactions]({{< relref "/develop/interact/transactions" >}}) +[Transactions]({{< relref "develop/using-commands/transactions" >}}) for more information about optimistic locking. The example below shows how to repeatedly attempt a transaction with a watched diff --git a/content/develop/clients/redis-vl.md b/content/develop/clients/redis-vl.md index 2097546d26..870c7883c8 100644 --- a/content/develop/clients/redis-vl.md +++ b/content/develop/clients/redis-vl.md @@ -16,4 +16,4 @@ title: Redis vector library guide (Python) weight: 2 --- -See the [RedisVL Guide]({{< relref "/integrate/redisvl" >}}) for more information. \ No newline at end of file +See the [RedisVL Guide]({{< relref "/develop/ai/redisvl" >}}) for more information. \ No newline at end of file diff --git a/content/develop/data-types/_index.md b/content/develop/data-types/_index.md index 16e9f7fc65..96e056be32 100644 --- a/content/develop/data-types/_index.md +++ b/content/develop/data-types/_index.md @@ -10,8 +10,8 @@ categories: - kubernetes - clients description: Overview of data types supported by Redis -linkTitle: Understand data types -title: Understand Redis data types +linkTitle: Data types +title: Redis data types hideListLinks: true weight: 35 --- @@ -217,5 +217,5 @@ For more information, see: To extend the features provided by the included data types, use one of these options: -1. Write your own custom [server-side functions in Lua]({{< relref "/develop/interact/programmability/" >}}). +1. Write your own custom [server-side functions in Lua]({{< relref "/develop/programmability/" >}}). 1. Write your own Redis module using the [modules API]({{< relref "/develop/reference/modules/" >}}) or check out the [community-supported modules]({{< relref "/operate/oss_and_stack/stack-with-enterprise/" >}}). diff --git a/content/develop/data-types/hashes.md b/content/develop/data-types/hashes.md index d75695a220..3f109ae6a6 100644 --- a/content/develop/data-types/hashes.md +++ b/content/develop/data-types/hashes.md @@ -101,7 +101,7 @@ See the [complete list of hash commands]({{< relref "/commands/" >}}?group=hash) ## Field expiration New in Redis Open Source 7.4 is the ability to specify an expiration time or a time-to-live (TTL) value for individual hash fields. -This capability is comparable to [key expiration]({{< relref "/develop/use/keyspace#key-expiration" >}}) and includes a number of similar commands. +This capability is comparable to [key expiration]({{< relref "/develop/using-commands/keyspace#key-expiration" >}}) and includes a number of similar commands. Use the following commands to set either an exact expiration time or a TTL value for specific fields: diff --git a/content/develop/get-started/data-store.md b/content/develop/get-started/data-store.md index 6b558122bc..a5b8096cb1 100644 --- a/content/develop/get-started/data-store.md +++ b/content/develop/get-started/data-store.md @@ -82,7 +82,7 @@ You can get a complete overview of available data types in this documentation si ## Scan the keyspace -Each item within Redis has a unique key. All items live within the Redis [keyspace]({{< relref "/develop/use/keyspace" >}}). You can scan the Redis keyspace via the [SCAN command]({{< relref "/commands/scan" >}}). Here is an example that scans for the first 100 keys that have the prefix `bike:`: +Each item within Redis has a unique key. All items live within the Redis [keyspace]({{< relref "/develop/using-commands/keyspace" >}}). You can scan the Redis keyspace via the [SCAN command]({{< relref "/commands/scan" >}}). Here is an example that scans for the first 100 keys that have the prefix `bike:`: ``` SCAN 0 MATCH "bike:*" COUNT 100 diff --git a/content/develop/get-started/redis-in-ai.md b/content/develop/get-started/redis-in-ai.md index 9494bd62ff..646def6fb7 100644 --- a/content/develop/get-started/redis-in-ai.md +++ b/content/develop/get-started/redis-in-ai.md @@ -21,7 +21,7 @@ Redis excels in storing and indexing vector embeddings that semantically represe - **Session Management**: in-memory data structures simplify managing session states in conversational AI scenarios. - **Flexibility**: Redis supports diverse data structures (for example, strings, hashes, lists, sets), allowing tailored solutions for GenAI apps. -[RedisVL]({{< relref "/integrate/redisvl" >}}) is a Python library with an integrated CLI, offering seamless integration with Redis to enhance GenAI applications. +[RedisVL]({{< relref "/develop/ai/redisvl" >}}) is a Python library with an integrated CLI, offering seamless integration with Redis to enhance GenAI applications. --- diff --git a/content/develop/get-started/vector-database.md b/content/develop/get-started/vector-database.md index 10d87c1ede..47842ac455 100644 --- a/content/develop/get-started/vector-database.md +++ b/content/develop/get-started/vector-database.md @@ -120,7 +120,7 @@ Inspect the structure of one of the bike JSON documents: {{< clients-example search_vss dump_data />}} ### 2. Store the demo data in Redis -Now iterate over the `bikes` array to store the data as [JSON]({{< relref "/develop/data-types/json/" >}}) documents in Redis by using the [JSON.SET]({{< relref "commands/json.set/" >}}) command. The below code uses a [pipeline]({{< relref "/develop/use/pipelining" >}}) to minimize the network round-trip times: +Now iterate over the `bikes` array to store the data as [JSON]({{< relref "/develop/data-types/json/" >}}) documents in Redis by using the [JSON.SET]({{< relref "commands/json.set/" >}}) command. The below code uses a [pipeline]({{< relref "/develop/using-commands/pipelining" >}}) to minimize the network round-trip times: {{< clients-example search_vss load_data />}} diff --git a/content/develop/interact/_index.md b/content/develop/interact/_index.md deleted file mode 100644 index d74d8d67f8..0000000000 --- a/content/develop/interact/_index.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: 'How to interact with data in Redis, including queries, triggered - functions, transactions, and pub/sub' -linkTitle: Interact with data -title: Interact with data in Redis -hideListLinks: true -weight: 40 ---- - -Redis is useful as a key-value store but also gives you other powerful ways -to interact with your data: - -- [Redis Query Engine](#search-and-query) -- [Programmability](#programmability) -- [Transactions](#transactions) -- [Publish/subscribe](#publishsubscribe) - -## Search and query with the Redis Query Engine - -The [Redis query engine]({{< relref "/develop/ai/search-and-query" >}}) -lets you retrieve data by content rather than by key. You -can [index]({{< relref "/develop/ai/search-and-query/indexing" >}}) -the fields of [hash]({{< relref "/develop/data-types/hashes" >}}) -and [JSON]({{< relref "/develop/data-types/json" >}}) objects -according to their type and then perform sophisticated -[queries]({{< relref "/develop/ai/search-and-query/query" >}}) -on those fields. For example, you can use queries to find: - - matches in - [text fields]({{< relref "/develop/ai/search-and-query/query/full-text" >}}) - - numeric values that fall within a specified - [range]({{< relref "/develop/ai/search-and-query/query/range" >}}) - - [Geospatial]({{< relref "/develop/ai/search-and-query/query/geo-spatial" >}}) - coordinates that fall within a specified area - - [Vector matches]({{< relref "/develop/ai/search-and-query/query/vector-search" >}}) - against [word embeddings](https://en.wikipedia.org/wiki/Word_embedding) calculated from - your text data - -## Programmability - -Redis has an [interface]({{< relref "/develop/interact/programmability" >}}) -for the [Lua programming language](https://www.lua.org/) -that lets you store and execute scripts on the server. Use scripts -to ensure that different clients always update data using the same logic. -You can also reduce network traffic by reimplementing a sequence of -related client-side commands as a single server script. - -## Transactions - -A client will often execute a sequence of commands to make -a set of related changes to data objects. However, another client could also -modify the same data object with similar commands in between. This situation can create -corrupt or inconsistent data. - -Use a [transaction]({{< relref "/develop/interact/transactions" >}}) to -group several commands from a client together as a single unit. The -commands in the transaction are guaranteed to execute in sequence without -interruptions from other clients' commands. - -You can also use the -[`WATCH`]({{< relref "/commands/watch" >}}) command to check for changes -to the keys used in a transaction just before it executes. If the data you -are watching changes while you construct the transaction then -execution safely aborts. Use this feature for efficient -[optimistic concurrency control](https://en.wikipedia.org/wiki/Optimistic_concurrency_control) -in the common case where data is usually accessed only by one client -at a time. - -## Publish/subscribe - -Redis has a [publish/subscribe]({{< relref "/develop/interact/pubsub" >}}) (Pub/sub) -feature that implements the well-known -[design pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) -of the same name. You can *publish* messages from a particular client -connection to a channel maintained by the server. Other connections that have -*subscribed* to the channel will receive the messages in the order you sent them. -Use pub/sub to share small amounts of data among clients easily and -efficiently. diff --git a/content/develop/interact/programmability/_index.md b/content/develop/programmability/_index.md similarity index 87% rename from content/develop/interact/programmability/_index.md rename to content/develop/programmability/_index.md index a302f92943..b2c40510e4 100644 --- a/content/develop/interact/programmability/_index.md +++ b/content/develop/programmability/_index.md @@ -9,15 +9,16 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/programmability description: 'Extending Redis with Lua and Redis Functions ' linkTitle: Programmability title: Redis programmability -weight: 20 +weight: 50 --- -Redis provides a programming interface that lets you execute custom scripts on the server itself. In Redis 7 and beyond, you can use [Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}) to manage and run your scripts. In Redis 6.2 and below, you use [Lua scripting with the EVAL command]({{< relref "/develop/interact/programmability/eval-intro" >}}) to program the server. +Redis provides a programming interface that lets you execute custom scripts on the server itself. In Redis 7 and beyond, you can use [Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}) to manage and run your scripts. In Redis 6.2 and below, you use [Lua scripting with the EVAL command]({{< relref "/develop/programmability/eval-intro" >}}) to program the server. ## Background @@ -36,7 +37,7 @@ Such APIs can encapsulate business logic and maintain a data model across multip User scripts are executed in Redis by an embedded, sandboxed scripting engine. Presently, Redis supports a single scripting engine, the [Lua 5.1](https://www.lua.org/) interpreter. -Please refer to the [Redis Lua API Reference]({{< relref "develop/interact/programmability/lua-api" >}}) page for complete documentation. +Please refer to the [Redis Lua API Reference]({{< relref "/develop/programmability/lua-api" >}}) page for complete documentation. ## Running scripts @@ -56,11 +57,11 @@ In this case, loading a function to the database becomes an administrative deplo Please refer to the following pages for more information: -* [Redis Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) -* [Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}) +* [Redis Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}) +* [Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}) When running a script or a function, Redis guarantees its atomic execution. -The script's execution blocks all server activities during its entire time, similarly to the semantics of [transactions]({{< relref "/develop/interact/transactions" >}}). +The script's execution blocks all server activities during its entire time, similarly to the semantics of [transactions]({{< relref "develop/using-commands/transactions" >}}). These semantics mean that all of the script's effects either have yet to happen or had already happened. The blocking semantics of an executed script apply to all connected clients at all times. @@ -71,7 +72,7 @@ However, if you intend to use a slow script in your application, be aware that a ## Read-only scripts A read-only script is a script that only executes commands that don't modify any keys within Redis. -Read-only scripts can be executed either by adding the `no-writes` [flag]({{< relref "develop/interact/programmability/lua-api#script_flags" >}}) to the script or by executing the script with one of the read-only script command variants: [`EVAL_RO`]({{< relref "/commands/eval_ro" >}}), [`EVALSHA_RO`]({{< relref "/commands/evalsha_ro" >}}), or [`FCALL_RO`]({{< relref "/commands/fcall_ro" >}}). +Read-only scripts can be executed either by adding the `no-writes` [flag]({{< relref "/develop/programmability/lua-api#script_flags" >}}) to the script or by executing the script with one of the read-only script command variants: [`EVAL_RO`]({{< relref "/commands/eval_ro" >}}), [`EVALSHA_RO`]({{< relref "/commands/evalsha_ro" >}}), or [`FCALL_RO`]({{< relref "/commands/fcall_ro" >}}). They have the following properties: * They can always be executed on replicas. @@ -91,7 +92,7 @@ In addition to the benefits provided by all read-only scripts, the read-only scr Read-only scripts and read-only script commands were introduced in Redis 7.0 * Before Redis 7.0.1 [`PUBLISH`]({{< relref "/commands/publish" >}}), [`SPUBLISH`]({{< relref "/commands/spublish" >}}) and [`PFCOUNT`]({{< relref "/commands/pfcount" >}}) were not considered write commands in scripts -* Before Redis 7.0.1 the `no-writes` [flag]({{< relref "develop/interact/programmability/lua-api#script_flags" >}}) did not imply `allow-oom` +* Before Redis 7.0.1 the `no-writes` [flag]({{< relref "/develop/programmability/lua-api#script_flags" >}}) did not imply `allow-oom` * Before Redis 7.0.1 the `no-writes` flag did not permit the script to run during write pauses. diff --git a/content/develop/interact/programmability/eval-intro.md b/content/develop/programmability/eval-intro.md similarity index 92% rename from content/develop/interact/programmability/eval-intro.md rename to content/develop/programmability/eval-intro.md index 7679101055..138d5a5171 100644 --- a/content/develop/interact/programmability/eval-intro.md +++ b/content/develop/programmability/eval-intro.md @@ -9,6 +9,7 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/programmability/eval-intro description: 'Executing Lua in Redis ' @@ -37,11 +38,11 @@ Such scripts can perform conditional updates across multiple keys, possibly comb Scripts are executed in Redis by an embedded execution engine. Presently, Redis supports a single scripting engine, the [Lua 5.1](https://www.lua.org/) interpreter. -Please refer to the [Redis Lua API Reference]({{< relref "develop/interact/programmability/lua-api" >}}) page for complete documentation. +Please refer to the [Redis Lua API Reference]({{< relref "/develop/programmability/lua-api" >}}) page for complete documentation. Although the server executes them, Eval scripts are regarded as a part of the client-side application, which is why they're not named, versioned, or persisted. So all scripts may need to be reloaded by the application at any time if missing (after a server restart, fail-over to a replica, etc.). -As of version 7.0, [Redis Functions]({{< relref "/develop/interact/programmability/functions-intro" >}}) offer an alternative approach to programmability which allow the server itself to be extended with additional programmed logic. +As of version 7.0, [Redis Functions]({{< relref "/develop/programmability/functions-intro" >}}) offer an alternative approach to programmability which allow the server itself to be extended with additional programmed logic. ## Getting started @@ -100,7 +101,7 @@ Any input to the function that isn't the name of a key is a regular input argume In the example above, both _Hello_ and _Parameterization!_ regular input arguments for the script. Because the script doesn't touch any keys, we use the numerical argument _0_ to specify there are no key name arguments. -The execution context makes arguments available to the script through [_KEYS_]({{< relref "develop/interact/programmability/lua-api#the-keys-global-variable" >}}) and [_ARGV_]({{< relref "develop/interact/programmability/lua-api#the-argv-global-variable" >}}) global runtime variables. +The execution context makes arguments available to the script through [_KEYS_]({{< relref "/develop/programmability/lua-api#the-keys-global-variable" >}}) and [_ARGV_]({{< relref "/develop/programmability/lua-api#the-argv-global-variable" >}}) global runtime variables. The _KEYS_ table is pre-populated with all key name arguments provided to the script before its execution, whereas the _ARGV_ table serves a similar purpose but for regular arguments. The following attempts to demonstrate the distribution of input arguments between the scripts _KEYS_ and _ARGV_ runtime global variables: @@ -117,11 +118,11 @@ redis> EVAL "return { KEYS[1], KEYS[2], ARGV[1], ARGV[2], ARGV[3] }" 2 key1 key2 **Note:** as can been seen above, Lua's table arrays are returned as [RESP2 array replies]({{< relref "/develop/reference/protocol-spec#resp-arrays" >}}), so it is likely that your client's library will convert it to the native array data type in your programming language. -Please refer to the rules that govern [data type conversion]({{< relref "develop/interact/programmability/lua-api#data-type-conversion" >}}) for more pertinent information. +Please refer to the rules that govern [data type conversion]({{< relref "/develop/programmability/lua-api#data-type-conversion" >}}) for more pertinent information. ## Interacting with Redis from a script -It is possible to call Redis commands from a Lua script either via [`redis.call()`]({{< relref "develop/interact/programmability/lua-api#redis.call" >}}) or [`redis.pcall()`]({{< relref "develop/interact/programmability/lua-api#redis.pcall" >}}). +It is possible to call Redis commands from a Lua script either via [`redis.call()`]({{< relref "/develop/programmability/lua-api#redis.call" >}}) or [`redis.pcall()`]({{< relref "/develop/programmability/lua-api#redis.pcall" >}}). The two are nearly identical. Both execute a Redis command along with its provided arguments, if these represent a well-formed command. @@ -190,7 +191,7 @@ Please consult your client's documentation regarding the specific details. ### `EVALSHA` in the context of pipelining -Special care should be given executing [`EVALSHA`]({{< relref "/commands/evalsha" >}}) in the context of a [pipelined request]({{< relref "/develop/use/pipelining" >}}). +Special care should be given executing [`EVALSHA`]({{< relref "/commands/evalsha" >}}) in the context of a [pipelined request]({{< relref "/develop/using-commands/pipelining" >}}). The commands in a pipelined request run in the order they are sent, but other clients' commands may be interleaved for execution between these. Because of that, the `NOSCRIPT` error can return from a pipelined request but can't be handled. @@ -228,13 +229,13 @@ These are: _1_ means the specific SHA1 is recognized as a script already present in the scripting cache. _0_'s meaning is that a script with this SHA1 wasn't loaded before (or at least never since the latest call to [`SCRIPT FLUSH`]({{< relref "/commands/script-flush" >}})). * `SCRIPT LOAD script`: this command registers the specified script in the Redis script cache. - It is a useful command in all the contexts where we want to ensure that [`EVALSHA`]({{< relref "/commands/evalsha" >}}) doesn't not fail (for instance, in a pipeline or when called from a [`MULTI`]({{< relref "/commands/multi" >}})/[`EXEC`]({{< relref "/commands/exec" >}}) [transaction]({{< relref "/develop/interact/transactions" >}}), without the need to execute the script. + It is a useful command in all the contexts where we want to ensure that [`EVALSHA`]({{< relref "/commands/evalsha" >}}) doesn't not fail (for instance, in a pipeline or when called from a [`MULTI`]({{< relref "/commands/multi" >}})/[`EXEC`]({{< relref "/commands/exec" >}}) [transaction]({{< relref "develop/using-commands/transactions" >}}), without the need to execute the script. * [`SCRIPT KILL`]({{< relref "/commands/script-kill" >}}): this command is the only way to interrupt a long-running script (a.k.a slow script), short of shutting down the server. - A script is deemed as slow once its execution's duration exceeds the configured [maximum execution time]({{< relref "/develop/interact/programmability/#maximum-execution-time" >}}) threshold. + A script is deemed as slow once its execution's duration exceeds the configured [maximum execution time]({{< relref "/develop/programmability/#maximum-execution-time" >}}) threshold. The [`SCRIPT KILL`]({{< relref "/commands/script-kill" >}}) command can be used only with scripts that did not modify the dataset during their execution (since stopping a read-only script does not violate the scripting engine's guaranteed atomicity). -* [`SCRIPT DEBUG`]({{< relref "/commands/script-debug" >}}): controls use of the built-in [Redis Lua scripts debugger]({{< relref "/develop/interact/programmability/lua-debugging" >}}). +* [`SCRIPT DEBUG`]({{< relref "/commands/script-debug" >}}): controls use of the built-in [Redis Lua scripts debugger]({{< relref "/develop/programmability/lua-debugging" >}}). ## Script replication @@ -255,7 +256,7 @@ There are two conceptual approaches when it comes to script replication: While potentially lengthier in terms of network traffic, this replication mode is deterministic by definition and therefore doesn't require special consideration. Verbatim script replication was the only mode supported until Redis 3.2, in which effects replication was added. -The _lua-replicate-commands_ configuration directive and [`redis.replicate_commands()`]({{< relref "develop/interact/programmability/lua-api#redis.replicate_commands" >}}) Lua API can be used to enable it. +The _lua-replicate-commands_ configuration directive and [`redis.replicate_commands()`]({{< relref "/develop/programmability/lua-api#redis.replicate_commands" >}}) Lua API can be used to enable it. In Redis 5.0, effects replication became the default mode. As of Redis 7.0, verbatim replication is no longer supported. @@ -270,7 +271,7 @@ We call this **script effects replication**. starting with Redis 5.0, script effects replication is the default mode and does not need to be explicitly enabled. In this replication mode, while Lua scripts are executed, Redis collects all the commands executed by the Lua scripting engine that actually modify the dataset. -When the script execution finishes, the sequence of commands that the script generated are wrapped into a [`MULTI`]({{< relref "/commands/multi" >}})/[`EXEC`]({{< relref "/commands/exec" >}}) [transaction]({{< relref "/develop/interact/transactions" >}}) and are sent to the replicas and AOF. +When the script execution finishes, the sequence of commands that the script generated are wrapped into a [`MULTI`]({{< relref "/commands/multi" >}})/[`EXEC`]({{< relref "/commands/exec" >}}) [transaction]({{< relref "develop/using-commands/transactions" >}}) and are sent to the replicas and AOF. This is useful in several ways depending on the use case: @@ -286,7 +287,7 @@ Unless already enabled by the server's configuration or defaults (before Redis 7 redis.replicate_commands() ``` -The [`redis.replicate_commands()`]({{< relref "develop/interact/programmability/lua-api#redis.replicate_commands" >}}) function returns _true) if script effects replication was enabled; +The [`redis.replicate_commands()`]({{< relref "/develop/programmability/lua-api#redis.replicate_commands" >}}) function returns _true) if script effects replication was enabled; otherwise, if the function was called after the script already called a write command, it returns _false_, and normal whole script replication is used. @@ -331,7 +332,7 @@ and undergo a silent lexicographical sorting filter before returning data to Lua However, starting with Redis 5.0, this ordering is no longer performed because replicating effects circumvents this type of non-determinism. In general, even when developing for Redis 4.0, never assume that certain commands in Lua will be ordered, but instead rely on the documentation of the original command you call to see the properties it provides. * Lua's pseudo-random number generation function `math.random` is modified and always uses the same seed for every execution. - This means that calling [`math.random`]({{< relref "develop/interact/programmability/lua-api#runtime-libraries" >}}) will always generate the same sequence of numbers every time a script is executed (unless `math.randomseed` is used). + This means that calling [`math.random`]({{< relref "/develop/programmability/lua-api#runtime-libraries" >}}) will always generate the same sequence of numbers every time a script is executed (unless `math.randomseed` is used). All that said, you can still use commands that write and random behavior with a simple trick. Imagine that you want to write a Redis script that will populate a list with N random integers. @@ -409,11 +410,11 @@ Note: an important part of this behavior is that the PRNG that Redis implements Starting with Redis 3.2, Redis has support for native Lua debugging. The Redis Lua debugger is a remote debugger consisting of a server, which is Redis itself, and a client, which is by default [`redis-cli`]({{< relref "/develop/tools/cli" >}}). -The Lua debugger is described in the [Lua scripts debugging]({{< relref "/develop/interact/programmability/lua-debugging" >}}) section of the Redis documentation. +The Lua debugger is described in the [Lua scripts debugging]({{< relref "/develop/programmability/lua-debugging" >}}) section of the Redis documentation. ## Execution under low memory conditions -When memory usage in Redis exceeds the `maxmemory` limit, the first write command encountered in the script that uses additional memory will cause the script to abort (unless [`redis.pcall`]({{< relref "develop/interact/programmability/lua-api#redis.pcall" >}}) was used). +When memory usage in Redis exceeds the `maxmemory` limit, the first write command encountered in the script that uses additional memory will cause the script to abort (unless [`redis.pcall`]({{< relref "/develop/programmability/lua-api#redis.pcall" >}}) was used). However, an exception to the above is when the script's first write command does not use additional memory, as is the case with (for example, [`DEL`]({{< relref "/commands/del" >}}) and [`LREM`]({{< relref "/commands/lrem" >}})). In this case, Redis will allow all commands in the script to run to ensure atomicity. @@ -446,4 +447,4 @@ it still has a different set of defaults compared to a script without a `#!` lin Another difference is that scripts without `#!` can run commands that access keys belonging to different cluster hash slots, but ones with `#!` inherit the default flags, so they cannot. -Please refer to [Script flags]({{< relref "develop/interact/programmability/lua-api#script_flags" >}}) to learn about the various scripts and the defaults. +Please refer to [Script flags]({{< relref "/develop/programmability/lua-api#script_flags" >}}) to learn about the various scripts and the defaults. diff --git a/content/develop/interact/programmability/functions-intro.md b/content/develop/programmability/functions-intro.md similarity index 93% rename from content/develop/interact/programmability/functions-intro.md rename to content/develop/programmability/functions-intro.md index ed96b9eadd..c19f64f442 100644 --- a/content/develop/interact/programmability/functions-intro.md +++ b/content/develop/programmability/functions-intro.md @@ -9,6 +9,7 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/programmability/functions-intro description: 'Scripting with Redis 7 and beyond ' @@ -17,12 +18,12 @@ title: Redis functions weight: 1 --- -Redis Functions is an API for managing code to be executed on the server. This feature, which became available in Redis 7, supersedes the use of [EVAL]({{< relref "/develop/interact/programmability/eval-intro" >}}) in prior versions of Redis. +Redis Functions is an API for managing code to be executed on the server. This feature, which became available in Redis 7, supersedes the use of [EVAL]({{< relref "/develop/programmability/eval-intro" >}}) in prior versions of Redis. ## Prologue (or, what's wrong with Eval Scripts?) Prior versions of Redis made scripting available only via the [`EVAL`]({{< relref "/commands/eval" >}}) command, which allows a Lua script to be sent for execution by the server. -The core use cases for [Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) is executing part of your application logic inside Redis, efficiently and atomically. +The core use cases for [Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}) is executing part of your application logic inside Redis, efficiently and atomically. Such script can perform conditional updates across multiple keys, possibly combining several different data types. Using [`EVAL`]({{< relref "/commands/eval" >}}) requires that the application sends the entire script for execution every time. @@ -36,9 +37,9 @@ The underlying assumption is that scripts are a part of the application and not This approach suits many light-weight scripting use cases, but introduces several difficulties once an application becomes complex and relies more heavily on scripting, namely: 1. All client application instances must maintain a copy of all scripts. That means having some mechanism that applies script updates to all of the application's instances. -1. Calling cached scripts within the context of a [transaction]({{< relref "/develop/interact/transactions" >}}) increases the probability of the transaction failing because of a missing script. Being more likely to fail makes using cached scripts as building blocks of workflows less attractive. +1. Calling cached scripts within the context of a [transaction]({{< relref "develop/using-commands/transactions" >}}) increases the probability of the transaction failing because of a missing script. Being more likely to fail makes using cached scripts as building blocks of workflows less attractive. 1. SHA1 digests are meaningless, making debugging the system extremely hard (e.g., in a [`MONITOR`]({{< relref "/commands/monitor" >}}) session). -1. When used naively, [`EVAL`]({{< relref "/commands/eval" >}}) promotes an anti-pattern in which scripts the client application renders verbatim scripts instead of responsibly using the [`KEYS` and `ARGV` Lua APIs]({{< relref "develop/interact/programmability/lua-api#runtime-globals" >}}). +1. When used naively, [`EVAL`]({{< relref "/commands/eval" >}}) promotes an anti-pattern in which scripts the client application renders verbatim scripts instead of responsibly using the [`KEYS` and `ARGV` Lua APIs]({{< relref "/develop/programmability/lua-api#runtime-globals" >}}). 1. Because they are ephemeral, a script can't call another script. This makes sharing and reusing code between scripts nearly impossible, short of client-side preprocessing (see the first point). To address these needs while avoiding breaking changes to already-established and well-liked ephemeral scripts, Redis v7.0 introduces Redis Functions. @@ -64,10 +65,10 @@ The Redis Functions feature makes no assumptions about the implementation's lang An execution engine that is part of the definition of the function handles running it. An engine can theoretically execute functions in any language as long as it respects several rules (such as the ability to terminate an executing function). -Presently, as noted above, Redis ships with a single embedded [Lua 5.1]({{< relref "develop/interact/programmability/lua-api" >}}) engine. +Presently, as noted above, Redis ships with a single embedded [Lua 5.1]({{< relref "/develop/programmability/lua-api" >}}) engine. There are plans to support additional engines in the future. Redis functions can use all of Lua's available capabilities to ephemeral scripts, -with the only exception being the [Redis Lua scripts debugger]({{< relref "/develop/interact/programmability/lua-debugging" >}}). +with the only exception being the [Redis Lua scripts debugger]({{< relref "/develop/programmability/lua-debugging" >}}). Functions also simplify development by enabling code sharing. Every function belongs to a single library, and any given library can consist of multiple functions. @@ -81,7 +82,7 @@ Functions are also persisted to the AOF file and replicated from master to repli When Redis is used as an ephemeral cache, additional mechanisms (described below) are required to make functions more durable. Like all other operations in Redis, the execution of a function is atomic. -A function's execution blocks all server activities during its entire time, similarly to the semantics of [transactions]({{< relref "/develop/interact/transactions" >}}). +A function's execution blocks all server activities during its entire time, similarly to the semantics of [transactions]({{< relref "develop/using-commands/transactions" >}}). These semantics mean that all of the script's effects either have yet to happen or had already happened. The blocking semantics of an executed function apply to all connected clients at all times. Because running a function blocks the Redis server, functions are meant to finish executing quickly, so you should avoid using long-running functions. @@ -90,7 +91,7 @@ Because running a function blocks the Redis server, functions are meant to finis Let's explore Redis Functions via some tangible examples and Lua snippets. -At this point, if you're unfamiliar with Lua in general and specifically in Redis, you may benefit from reviewing some of the examples in [Introduction to Eval Scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) and [Lua API]({{< relref "develop/interact/programmability/lua-api" >}}) pages for a better grasp of the language. +At this point, if you're unfamiliar with Lua in general and specifically in Redis, you may benefit from reviewing some of the examples in [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}) and [Lua API]({{< relref "/develop/programmability/lua-api" >}}) pages for a better grasp of the language. Every Redis function belongs to a single library that's loaded to Redis. Loading a library to the database is done with the [`FUNCTION LOAD`]({{< relref "/commands/function-load" >}}) command. @@ -245,7 +246,7 @@ redis.register_function('my_hgetall', my_hgetall) redis.register_function('my_hlastmodified', my_hlastmodified) ``` -While all of the above should be straightforward, note that the `my_hgetall` also calls [`redis.setresp(3)`]({{< relref "develop/interact/programmability/lua-api#redis.setresp" >}}). +While all of the above should be straightforward, note that the `my_hgetall` also calls [`redis.setresp(3)`]({{< relref "/develop/programmability/lua-api#redis.setresp" >}}). That means that the function expects [RESP3](https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md) replies after calling `redis.call()`, which, unlike the default RESP2 protocol, provides dictionary (associative arrays) replies. Doing so allows the function to delete (or set to `nil` as is the case with Lua tables) specific fields from the reply, and in our case, the `_last_modified_` field. @@ -303,7 +304,7 @@ You can see that it is easy to update our library with new capabilities. On top of bundling functions together into database-managed software artifacts, libraries also facilitate code sharing. We can add to our library an error handling helper function called from other functions. The helper function `check_keys()` verifies that the input _keys_ table has a single key. -Upon success it returns `nil`, otherwise it returns an [error reply]({{< relref "develop/interact/programmability/lua-api#redis.error_reply" >}}). +Upon success it returns `nil`, otherwise it returns an [error reply]({{< relref "/develop/programmability/lua-api#redis.error_reply" >}}). The updated library's source code would be: @@ -426,7 +427,7 @@ The server will reply with this error in the following cases: 3. A disk error was detected (Redis is unable to persist so it rejects writes). In these cases, you can add the `no-writes` flag to the function's registration, disable the safeguard and allow them to run. -To register a function with flags use the [named arguments]({{< relref "develop/interact/programmability/lua-api#redis.register_function_named_args" >}}) variant of `redis.register_function`. +To register a function with flags use the [named arguments]({{< relref "/develop/programmability/lua-api#redis.register_function_named_args" >}}) variant of `redis.register_function`. The updated registration code snippet from the library looks like this: @@ -456,4 +457,4 @@ redis> FCALL_RO my_hlastmodified 1 myhash "1640772721" ``` -For the complete documentation flags, please refer to [Script flags]({{< relref "develop/interact/programmability/lua-api#script_flags" >}}). +For the complete documentation flags, please refer to [Script flags]({{< relref "/develop/programmability/lua-api#script_flags" >}}). diff --git a/content/develop/interact/programmability/lua-api.md b/content/develop/programmability/lua-api.md similarity index 96% rename from content/develop/interact/programmability/lua-api.md rename to content/develop/programmability/lua-api.md index 24151fb80a..bba2e6c415 100644 --- a/content/develop/interact/programmability/lua-api.md +++ b/content/develop/programmability/lua-api.md @@ -9,6 +9,7 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/programmability/lua-api description: 'Executing Lua in Redis ' @@ -18,7 +19,7 @@ weight: 3 --- Redis includes an embedded [Lua 5.1](https://www.lua.org/) interpreter. -The interpreter runs user-defined [ephemeral scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}) and [functions]({{< relref "/develop/interact/programmability/functions-intro" >}}). Scripts run in a sandboxed context and can only access specific Lua packages. This page describes the packages and APIs available inside the execution's context. +The interpreter runs user-defined [ephemeral scripts]({{< relref "/develop/programmability/eval-intro" >}}) and [functions]({{< relref "/develop/programmability/functions-intro" >}}). Scripts run in a sandboxed context and can only access specific Lua packages. This page describes the packages and APIs available inside the execution's context. ## Sandbox context @@ -104,7 +105,7 @@ to ensure the correct execution of scripts, both in standalone and clustered dep The script **should only** access keys whose names are given as input arguments. Scripts **should never** access keys with programmatically-generated names or based on the contents of data structures stored in the database. -The _KEYS_ global variable is available only for [ephemeral scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +The _KEYS_ global variable is available only for [ephemeral scripts]({{< relref "/develop/programmability/eval-intro" >}}). It is pre-populated with all key name input arguments. ### The _ARGV_ global variable {#the-argv-global-variable} @@ -113,7 +114,7 @@ It is pre-populated with all key name input arguments. * Available in scripts: yes * Available in functions: no -The _ARGV_ global variable is available only in [ephemeral scripts]({{< relref "/develop/interact/programmability/eval-intro" >}}). +The _ARGV_ global variable is available only in [ephemeral scripts]({{< relref "/develop/programmability/eval-intro" >}}). It is pre-populated with all regular input arguments. ## _redis_ object {#redis_object} @@ -149,7 +150,7 @@ redis> EVAL "return redis.call('ECHO', 'Echo,', 'echo... ', 'eco... ', 'o...')" (error) ERR Wrong number of args calling Redis command from script script: b0345693f4b77517a711221050e76d24ae60b7f7, on @user_script:1. ``` -Note that the call can fail due to various reasons, see [Execution under low memory conditions]({{< relref "/develop/interact/programmability/eval-intro#execution-under-low-memory-conditions" >}}) and [Script flags](#script_flags) +Note that the call can fail due to various reasons, see [Execution under low memory conditions]({{< relref "/develop/programmability/eval-intro#execution-under-low-memory-conditions" >}}) and [Script flags](#script_flags) To handle Redis runtime errors use `redis.pcall()` instead. @@ -380,7 +381,7 @@ You can use it to override the default verbatim script replication mode used by **Note:** as of Redis v7.0, verbatim script replication is no longer supported. The default, and only script replication mode supported, is script effects' replication. -For more information, please refer to [`Replicating commands instead of scripts`]({{< relref "/develop/interact/programmability/eval-intro#replicating-commands-instead-of-scripts" >}}) +For more information, please refer to [`Replicating commands instead of scripts`]({{< relref "/develop/programmability/eval-intro#replicating-commands-instead-of-scripts" >}}) ### `redis.breakpoint()` {#redis.breakpoint} @@ -388,7 +389,7 @@ For more information, please refer to [`Replicating commands instead of scripts` * Available in scripts: yes * Available in functions: no -This function triggers a breakpoint when using the [Redis Lua debugger]({{< relref "/develop/interact/programmability/lua-debugging" >}}). +This function triggers a breakpoint when using the [Redis Lua debugger]({{< relref "/develop/programmability/lua-debugging" >}}). ### `redis.debug(x)` {#redis.debug} @@ -396,7 +397,7 @@ This function triggers a breakpoint when using the [Redis Lua debugger]({{< relr * Available in scripts: yes * Available in functions: no -This function prints its argument in the [Redis Lua debugger]({{< relref "/develop/interact/programmability/lua-debugging" >}}) console. +This function prints its argument in the [Redis Lua debugger]({{< relref "/develop/programmability/lua-debugging" >}}) console. ### `redis.acl_check_cmd(command [,arg...])` {#redis.acl_check_cmd} @@ -451,7 +452,7 @@ redis> FUNCTION LOAD "#!lua name=mylib\n redis.register_function{function_name=' **Important:** Use script flags with care, which may negatively impact if misused. -Note that the default for Eval scripts are different than the default for functions that are mentioned below, see [Eval Flags]({{< relref "develop/interact/programmability/eval-intro#eval-flags" >}}) +Note that the default for Eval scripts are different than the default for functions that are mentioned below, see [Eval Flags]({{< relref "/develop/programmability/eval-intro#eval-flags" >}}) When you register a function or load an Eval script, the server does not know how it accesses the database. By default, Redis assumes that all scripts read and write data. @@ -466,7 +467,7 @@ You can use the following flags and instruct the server to treat the scripts' ex * `no-writes`: this flag indicates that the script only reads data but never writes. - By default, Redis will deny the execution of flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/interact/programmability/eval-intro#eval-flags" >}})) against read-only replicas, as they may attempt to perform writes. + By default, Redis will deny the execution of flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/programmability/eval-intro#eval-flags" >}})) against read-only replicas, as they may attempt to perform writes. Similarly, the server will not allow calling scripts with [`FCALL_RO`]({{< relref "/commands/fcall_ro" >}}) / [`EVAL_RO`]({{< relref "/commands/eval_ro" >}}). Lastly, when data persistence is at risk due to a disk error, execution is blocked as well. @@ -479,15 +480,15 @@ You can use the following flags and instruct the server to treat the scripts' ex However, note that the server will return an error if the script attempts to call a write command. Also note that currently [`PUBLISH`]({{< relref "/commands/publish" >}}), [`SPUBLISH`]({{< relref "/commands/spublish" >}}) and [`PFCOUNT`]({{< relref "/commands/pfcount" >}}) are also considered write commands in scripts, because they could attempt to propagate commands to replicas and AOF file. - For more information please refer to [Read-only scripts]({{< relref "develop/interact/programmability/#read-only_scripts" >}}) + For more information please refer to [Read-only scripts]({{< relref "/develop/programmability/#read-only_scripts" >}}) * `allow-oom`: use this flag to allow a script to execute when the server is out of memory (OOM). - Unless used, Redis will deny the execution of flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/interact/programmability/eval-intro#eval-flags" >}})) when in an OOM state. + Unless used, Redis will deny the execution of flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/programmability/eval-intro#eval-flags" >}})) when in an OOM state. Furthermore, when you use this flag, the script can call any Redis command, including commands that aren't usually allowed in this state. Specifying `no-writes` or using [`FCALL_RO`]({{< relref "/commands/fcall_ro" >}}) / [`EVAL_RO`]({{< relref "/commands/eval_ro" >}}) also implies the script can run in OOM state (without specifying `allow-oom`) -* `allow-stale`: a flag that enables running the flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/interact/programmability/eval-intro#eval-flags" >}})) against a stale replica when the `replica-serve-stale-data` config is set to `no` . +* `allow-stale`: a flag that enables running the flagged scripts (Functions and Eval scripts with [shebang]({{< relref "/develop/programmability/eval-intro#eval-flags" >}})) against a stale replica when the `replica-serve-stale-data` config is set to `no` . Redis can be set to prevent data consistency problems from using old data by having stale replicas return a runtime error. For scripts that do not access the data, this flag can be set to allow stale Redis replicas to run the script. @@ -507,7 +508,7 @@ You can use the following flags and instruct the server to treat the scripts' ex This flag has no effect when cluster mode is disabled. -Please refer to [Function Flags]({{< relref "develop/interact/programmability/functions-intro#function-flags" >}}) and [Eval Flags]({{< relref "develop/interact/programmability/eval-intro#eval-flags" >}}) for a detailed example. +Please refer to [Function Flags]({{< relref "/develop/programmability/functions-intro#function-flags" >}}) and [Eval Flags]({{< relref "/develop/programmability/eval-intro#eval-flags" >}}) for a detailed example. ### `redis.REDIS_VERSION` {#redis.redis_version} diff --git a/content/develop/interact/programmability/lua-debugging.md b/content/develop/programmability/lua-debugging.md similarity index 99% rename from content/develop/interact/programmability/lua-debugging.md rename to content/develop/programmability/lua-debugging.md index ba0e166979..3cc6529944 100644 --- a/content/develop/interact/programmability/lua-debugging.md +++ b/content/develop/programmability/lua-debugging.md @@ -9,6 +9,7 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/programmability/lua-debugging description: How to use the built-in Lua debugger linkTitle: Debugging Lua title: Debugging Lua scripts in Redis diff --git a/content/develop/interact/pubsub.md b/content/develop/pubsub/_index.md similarity index 99% rename from content/develop/interact/pubsub.md rename to content/develop/pubsub/_index.md index 51564d45ae..4a1321c754 100644 --- a/content/develop/interact/pubsub.md +++ b/content/develop/pubsub/_index.md @@ -11,8 +11,10 @@ categories: - clients description: How to use pub/sub channels in Redis linkTitle: Pub/sub -title: Redis Pub/Sub -weight: 40 +title: Redis Pub/sub +aliases: /develop/interact/pubsub +hideListLinks: true +weight: 60 --- [`SUBSCRIBE`]({{< relref "/commands/subscribe" >}}), [`UNSUBSCRIBE`]({{< relref "/commands/unsubscribe" >}}) and [`PUBLISH`]({{< relref "/commands/publish" >}}) implement the [Publish/Subscribe messaging paradigm](http://en.wikipedia.org/wiki/Publish/subscribe) where (citing Wikipedia) senders (publishers) are not programmed to send their messages to specific receivers (subscribers). diff --git a/content/develop/use/keyspace-notifications.md b/content/develop/pubsub/keyspace-notifications.md similarity index 99% rename from content/develop/use/keyspace-notifications.md rename to content/develop/pubsub/keyspace-notifications.md index ebc98e8f0e..549224c29b 100644 --- a/content/develop/use/keyspace-notifications.md +++ b/content/develop/pubsub/keyspace-notifications.md @@ -14,6 +14,7 @@ description: 'Monitor changes to Redis keys and values in real time ' linkTitle: Keyspace notifications title: Redis keyspace notifications +aliases: /develop/use/keyspace-notifications weight: 4 --- diff --git a/content/develop/reference/modules/modules-api-ref.md b/content/develop/reference/modules/modules-api-ref.md index 0bd64c3083..6b1feba59d 100644 --- a/content/develop/reference/modules/modules-api-ref.md +++ b/content/develop/reference/modules/modules-api-ref.md @@ -58,6 +58,7 @@ weight: 1 * [Server hooks implementation](#section-server-hooks-implementation) * [Module Configurations API](#section-module-configurations-api) * [RDB load/save API](#section-rdb-load-save-api) +* [Config access API](#section-config-access-api) * [Key eviction API](#section-key-eviction-api) * [Miscellaneous APIs](#section-miscellaneous-apis) * [Defrag API](#section-defrag-api) @@ -3166,7 +3167,7 @@ The returned `RedisModuleString` objects should be released with mstime_t RedisModule_HashFieldMinExpire(RedisModuleKey *key); -**Available since:** unreleased +**Available since:** 8.0.0 Retrieves the minimum expiration time of fields in a hash. @@ -5042,7 +5043,13 @@ is interested in. This can be an ORed mask of any of the following flags: this notification is wrong and discourage. It will cause the read command that trigger the event to be replicated to the AOF/Replica. - - `REDISMODULE_NOTIFY_ALL`: All events (Excluding `REDISMODULE_NOTIFY_KEYMISS`) + + - `REDISMODULE_NOTIFY_NEW`: New key notification + - `REDISMODULE_NOTIFY_OVERWRITTEN`: Overwritten events + - `REDISMODULE_NOTIFY_TYPE_CHANGED`: Type-changed events + - `REDISMODULE_NOTIFY_ALL`: All events (Excluding `REDISMODULE_NOTIFY_KEYMISS`, + REDISMODULE_NOTIFY_NEW, REDISMODULE_NOTIFY_OVERWRITTEN + and REDISMODULE_NOTIFY_TYPE_CHANGED) - `REDISMODULE_NOTIFY_LOADED`: A special notification available only for modules, indicates that the key was loaded from persistence. Notice, when this event fires, the given key @@ -5650,7 +5657,7 @@ If the user is able to access the key then `REDISMODULE_OK` is returned, otherwi RedisModuleString *prefix, int flags); -**Available since:** unreleased +**Available since:** 8.0.0 Check if the user can access keys matching the given key prefix according to the ACLs attached to the user and the flags representing key access. The flags are the same that @@ -7435,7 +7442,7 @@ Create an integer config that server clients can interact with via the int RedisModule_LoadDefaultConfigs(RedisModuleCtx *ctx); -**Available since:** unreleased +**Available since:** 8.0.0 Applies all default configurations for the parameters the module registered. Only call this function if the module would like to make changes to the @@ -7542,12 +7549,273 @@ Example: const char* RedisModule_GetInternalSecret(RedisModuleCtx *ctx, size_t *len); -**Available since:** unreleased +**Available since:** 8.0.0 Returns the internal secret of the cluster. Should be used to authenticate as an internal connection to a node in the cluster, and by that gain the permissions to execute internal commands. + + +## Config access API + + + +### `RedisModule_ConfigIteratorCreate` + + RedisModuleConfigIterator *RedisModule_ConfigIteratorCreate(RedisModuleCtx *ctx, + const char *pattern); + +**Available since:** unreleased + +Get an iterator to all configs. +Optional `ctx` can be provided if use of auto-memory is desired. +Optional `pattern` can be provided to filter configs by name. If `pattern` is +NULL all configs will be returned. + +The returned iterator can be used to iterate over all configs using +[`RedisModule_ConfigIteratorNext()`](#RedisModule_ConfigIteratorNext). + +Example usage: +``` +// Below is same as [`RedisModule_ConfigIteratorCreate`](#RedisModule_ConfigIteratorCreate)(ctx, NULL) +`RedisModuleConfigIterator` *iter = [`RedisModule_ConfigIteratorCreate`](#RedisModule_ConfigIteratorCreate)(ctx, "*"); +const char *config_name = NULL; +while ((`config_name` = [`RedisModule_ConfigIteratorNext`](#RedisModule_ConfigIteratorNext)(iter)) != NULL) { + RedisModuleString *value = NULL; + if (RedisModule_ConfigGet(ctx, config_name, &value) == REDISMODULE_OK) { + // Do something with `value`... + RedisModule_FreeString(ctx, value); + } +} +[`RedisModule_ConfigIteratorRelease`](#RedisModule_ConfigIteratorRelease)(ctx, iter); + +// Or optionally one can check the type to get the config value directly +// via the appropriate API in case performance is of consideration +iter = [`RedisModule_ConfigIteratorCreate`](#RedisModule_ConfigIteratorCreate)(ctx, "*"); +while ((`config_name` = [`RedisModule_ConfigIteratorNext`](#RedisModule_ConfigIteratorNext)(iter)) != NULL) { + RedisModuleConfigType type = RedisModule_ConfigGetType(config_name); + if (type == REDISMODULE_CONFIG_TYPE_STRING) { + RedisModuleString *value; + RedisModule_ConfigGet(ctx, config_name, &value); + // Do something with `value`... + RedisModule_FreeString(ctx, value); + } if (type == REDISMODULE_CONFIG_TYPE_NUMERIC) { + long long value; + RedisModule_ConfigGetNumeric(ctx, config_name, &value); + // Do something with `value`... + } else if (type == REDISMODULE_CONFIG_TYPE_BOOL) { + int value; + RedisModule_ConfigGetBool(ctx, config_name, &value); + // Do something with `value`... + } else if (type == REDISMODULE_CONFIG_TYPE_ENUM) { + RedisModuleString *value; + RedisModule_ConfigGetEnum(ctx, config_name, &value); + // Do something with `value`... + RedisModule_Free(value); + } +} +[`RedisModule_ConfigIteratorRelease`](#RedisModule_ConfigIteratorRelease)(ctx, iter); +``` + +Returns a pointer to `RedisModuleConfigIterator`. Unless auto-memory is enabled +the caller is responsible for freeing the iterator using +[`RedisModule_ConfigIteratorRelease()`](#RedisModule_ConfigIteratorRelease). + + + +### `RedisModule_ConfigIteratorRelease` + + void RedisModule_ConfigIteratorRelease(RedisModuleCtx *ctx, + RedisModuleConfigIterator *iter); + +**Available since:** unreleased + +Release the iterator returned by [`RedisModule_ConfigIteratorCreate()`](#RedisModule_ConfigIteratorCreate). If auto-memory +is enabled and manual release is needed one must pass the same `RedisModuleCtx` +that was used to create the iterator. + + + +### `RedisModule_ConfigGetType` + + int RedisModule_ConfigGetType(const char *name, RedisModuleConfigType *res); + +**Available since:** unreleased + +Get the type of a config as `RedisModuleConfigType`. One may use this in order +to get or set the values of the config with the appropriate function if the +generic [`RedisModule_ConfigGet`](#RedisModule_ConfigGet) and [`RedisModule_ConfigSet`](#RedisModule_ConfigSet) APIs are performing +poorly. + +Intended usage of this function is when iteration over the configs is +performed. See [`RedisModule_ConfigIteratorNext()`](#RedisModule_ConfigIteratorNext) for example usage. If setting +or getting individual configs one can check the config type by hand in +redis.conf (or via other sources if config is added by a module) and use the +appropriate function without the need to call this function. + +Explanation of config types: + - `REDISMODULE_CONFIG_TYPE_BOOL`: Config is a boolean. One can use `RedisModule_Config`(Get/Set)Bool + - `REDISMODULE_CONFIG_TYPE_NUMERIC`: Config is a numeric value. One can use `RedisModule_Config`(Get/Set)Numeric + - `REDISMODULE_CONFIG_TYPE_STRING`: Config is a string. One can use the generic `RedisModule_Config`(Get/Set) + - `REDISMODULE_CONFIG_TYPE_ENUM`: Config is an enum. One can use `RedisModule_Config`(Get/Set)Enum + +If a config with the given name exists `res` is populated with its type, else +`REDISMODULE_ERR` is returned. + + + +### `RedisModule_ConfigIteratorNext` + + const char *RedisModule_ConfigIteratorNext(RedisModuleConfigIterator *iter); + +**Available since:** unreleased + +Go to the next element of the config iterator. + +Returns the name of the next config, or NULL if there are no more configs. +Returned string is non-owning and thus should not be freed. +If a pattern was provided when creating the iterator, only configs matching +the pattern will be returned. + +See [`RedisModule_ConfigIteratorCreate()`](#RedisModule_ConfigIteratorCreate) for example usage. + + + +### `RedisModule_ConfigGet` + + int RedisModule_ConfigGet(RedisModuleCtx *ctx, + const char *name, + RedisModuleString **res); + +**Available since:** unreleased + +Get the value of a config as a string. This function can be used to get the +value of any config, regardless of its type. + +The string is allocated by the module and must be freed by the caller unless +auto memory is enabled. + +If the config does not exist, `REDISMODULE_ERR` is returned, else `REDISMODULE_OK` +is returned and `res` is populated with the value. + + + +### `RedisModule_ConfigGetBool` + + int RedisModule_ConfigGetBool(RedisModuleCtx *ctx, const char *name, int *res); + +**Available since:** unreleased + +Get the value of a bool config. + +If the config does not exist or is not a bool config, `REDISMODULE_ERR` is +returned, else `REDISMODULE_OK` is returned and `res` is populated with the +value. + + + +### `RedisModule_ConfigGetEnum` + + int RedisModule_ConfigGetEnum(RedisModuleCtx *ctx, + const char *name, + RedisModuleString **res); + +**Available since:** unreleased + +Get the value of an enum config. + +If the config does not exist or is not an enum config, `REDISMODULE_ERR` is +returned, else `REDISMODULE_OK` is returned and `res` is populated with the value. +If the config has multiple arguments they are returned as a space-separated +string. + + + +### `RedisModule_ConfigGetNumeric` + + int RedisModule_ConfigGetNumeric(RedisModuleCtx *ctx, + const char *name, + long long *res); + +**Available since:** unreleased + +Get the value of a numeric config. + +If the config does not exist or is not a numeric config, `REDISMODULE_ERR` is +returned, else `REDISMODULE_OK` is returned and `res` is populated with the +value. + + + +### `RedisModule_ConfigSet` + + int RedisModule_ConfigSet(RedisModuleCtx *ctx, + const char *name, + RedisModuleString *value, + RedisModuleString **err); + +**Available since:** unreleased + +Set the value of a config. + +This function can be used to set the value of any config, regardless of its +type. If the config is multi-argument, the value must be a space-separated +string. + +If the value failed to be set `REDISMODULE_ERR` will be returned and if `err` +is not NULL, it will be populated with an error message. + + + +### `RedisModule_ConfigSetBool` + + int RedisModule_ConfigSetBool(RedisModuleCtx *ctx, + const char *name, + int value, + RedisModuleString **err); + +**Available since:** unreleased + +Set the value of a bool config. + +See [`RedisModule_ConfigSet`](#RedisModule_ConfigSet) for return value. + + + +### `RedisModule_ConfigSetEnum` + + int RedisModule_ConfigSetEnum(RedisModuleCtx *ctx, + const char *name, + RedisModuleString *value, + RedisModuleString **err); + +**Available since:** unreleased + +Set the value of an enum config. + +If the config is multi-argument the value parameter must be a space-separated +string. + +See [`RedisModule_ConfigSet`](#RedisModule_ConfigSet) for return value. + + + +### `RedisModule_ConfigSetNumeric` + + int RedisModule_ConfigSetNumeric(RedisModuleCtx *ctx, + const char *name, + long long value, + RedisModuleString **err); + +**Available since:** unreleased + +Set the value of a numeric config. +If the value passed is meant to be a percentage, it should be passed as a +negative value. + +See [`RedisModule_ConfigSet`](#RedisModule_ConfigSet) for return value. + ## Key eviction API @@ -7801,7 +8069,7 @@ may allocate that is not tied to a specific data type. int RedisModule_RegisterDefragFunc2(RedisModuleCtx *ctx, RedisModuleDefragFunc2 cb); -**Available since:** unreleased +**Available since:** 8.0.0 Register a defrag callback for global data, i.e. anything that the module may allocate that is not tied to a specific data type. @@ -7817,7 +8085,7 @@ in and indicate that it should be called again later, or is it done (returned 0) RedisModuleDefragFunc start, RedisModuleDefragFunc end); -**Available since:** unreleased +**Available since:** 8.0.0 Register a defrag callbacks that will be called when defrag operation starts and ends. @@ -7914,7 +8182,7 @@ be used again. void *RedisModule_DefragAllocRaw(RedisModuleDefragCtx *ctx, size_t size); -**Available since:** unreleased +**Available since:** 8.0.0 Allocate memory for defrag purposes @@ -7934,7 +8202,7 @@ allow to support more complex defrag usecases. void RedisModule_DefragFreeRaw(RedisModuleDefragCtx *ctx, void *ptr); -**Available since:** unreleased +**Available since:** 8.0.0 Free memory for defrag purposes @@ -7968,7 +8236,7 @@ on the Redis side is dropped as soon as the command callback returns). RedisModuleDefragDictValueCallback valueCB, RedisModuleString **seekTo); -**Available since:** unreleased +**Available since:** 8.0.0 Defragment a Redis Module Dictionary by scanning its contents and calling a value callback for each value. @@ -8061,6 +8329,18 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_CommandFilterArgReplace`](#RedisModule_CommandFilterArgReplace) * [`RedisModule_CommandFilterArgsCount`](#RedisModule_CommandFilterArgsCount) * [`RedisModule_CommandFilterGetClientId`](#RedisModule_CommandFilterGetClientId) +* [`RedisModule_ConfigGet`](#RedisModule_ConfigGet) +* [`RedisModule_ConfigGetBool`](#RedisModule_ConfigGetBool) +* [`RedisModule_ConfigGetEnum`](#RedisModule_ConfigGetEnum) +* [`RedisModule_ConfigGetNumeric`](#RedisModule_ConfigGetNumeric) +* [`RedisModule_ConfigGetType`](#RedisModule_ConfigGetType) +* [`RedisModule_ConfigIteratorCreate`](#RedisModule_ConfigIteratorCreate) +* [`RedisModule_ConfigIteratorNext`](#RedisModule_ConfigIteratorNext) +* [`RedisModule_ConfigIteratorRelease`](#RedisModule_ConfigIteratorRelease) +* [`RedisModule_ConfigSet`](#RedisModule_ConfigSet) +* [`RedisModule_ConfigSetBool`](#RedisModule_ConfigSetBool) +* [`RedisModule_ConfigSetEnum`](#RedisModule_ConfigSetEnum) +* [`RedisModule_ConfigSetNumeric`](#RedisModule_ConfigSetNumeric) * [`RedisModule_CreateCommand`](#RedisModule_CreateCommand) * [`RedisModule_CreateDataType`](#RedisModule_CreateDataType) * [`RedisModule_CreateDict`](#RedisModule_CreateDict) @@ -8373,4 +8653,3 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_ZsetRem`](#RedisModule_ZsetRem) * [`RedisModule_ZsetScore`](#RedisModule_ZsetScore) * [`RedisModule__Assert`](#RedisModule__Assert) - diff --git a/content/develop/reference/protocol-spec.md b/content/develop/reference/protocol-spec.md index 6b854f21f4..459494cd71 100644 --- a/content/develop/reference/protocol-spec.md +++ b/content/develop/reference/protocol-spec.md @@ -70,7 +70,7 @@ This is the simplest model possible; however, there are some exceptions: * Redis requests can be [pipelined](#multiple-commands-and-pipelining). Pipelining enables clients to send multiple commands at once and wait for replies later. -* When a RESP2 connection subscribes to a [Pub/Sub]({{< relref "/develop/interact/pubsub" >}}) channel, the protocol changes semantics and becomes a *push* protocol. +* When a RESP2 connection subscribes to a [Pub/Sub]({{< relref "/develop/pubsub" >}}) channel, the protocol changes semantics and becomes a *push* protocol. The client no longer requires sending commands because the server will automatically send new messages to the client (for the channels the client is subscribed to) as soon as they are received. * The [`MONITOR`]({{< relref "/commands/monitor" >}}) command. Invoking the [`MONITOR`]({{< relref "/commands/monitor" >}}) command switches the connection to an ad-hoc push mode. @@ -696,7 +696,7 @@ Pipelining is supported, so multiple commands can be sent with a single write op The client can skip reading replies and continue to send the commands one after the other. All the replies can be read at the end. -For more information, see [Pipelining]({{< relref "/develop/use/pipelining" >}}). +For more information, see [Pipelining]({{< relref "/develop/using-commands/pipelining" >}}). ## Inline commands Sometimes you may need to send a command to the Redis server but only have `telnet` available. @@ -755,7 +755,7 @@ While comparable in performance to a binary protocol, the Redis protocol is sign ## Tips for Redis client authors -* For testing purposes, use [Lua's type conversions]({{< relref "develop/interact/programmability/lua-api#lua-to-resp3-type-conversion" >}}) to have Redis reply with any RESP2/RESP3 needed. +* For testing purposes, use [Lua's type conversions]({{< relref "develop/programmability/lua-api#lua-to-resp3-type-conversion" >}}) to have Redis reply with any RESP2/RESP3 needed. As an example, a RESP3 double can be generated like so: ``` EVAL "return { double = tonumber(ARGV[1]) }" 0 1e0 diff --git a/content/develop/tools/cli.md b/content/develop/tools/cli.md index 131a24df60..bc4e274361 100644 --- a/content/develop/tools/cli.md +++ b/content/develop/tools/cli.md @@ -223,7 +223,7 @@ To monitor over time the RSS memory size it's possible to use the following comm ## Mass insertion of data using `redis-cli` Mass insertion using `redis-cli` is covered in a separate page as it is a -worthwhile topic itself. Please refer to our [mass insertion guide]({{< relref "/develop/use/patterns/bulk-loading" >}}). +worthwhile topic itself. Please refer to our [mass insertion guide]({{< relref "/develop/clients/patterns/bulk-loading" >}}). ## CSV output @@ -239,7 +239,7 @@ Note that the `--csv` flag will only work on a single command, not the entirety ## Run Lua scripts The `redis-cli` has extensive support for using the debugging facility -of Lua scripting, available with Redis 3.2 onwards. For this feature, refer to the [Redis Lua debugger documentation]({{< relref "/develop/interact/programmability/lua-debugging" >}}). +of Lua scripting, available with Redis 3.2 onwards. For this feature, refer to the [Redis Lua debugger documentation]({{< relref "/develop/programmability/lua-debugging" >}}). Even without using the debugger, `redis-cli` can be used to run scripts from a file as an argument: @@ -450,7 +450,7 @@ are explained in the next sections: * Monitoring tool to show continuous stats about a Redis server. * Scanning a Redis database for very large keys. * Key space scanner with pattern matching. -* Acting as a [Pub/Sub]({{< relref "/develop/interact/pubsub" >}}) client to subscribe to channels. +* Acting as a [Pub/Sub]({{< relref "/develop/pubsub" >}}) client to subscribe to channels. * Monitoring the commands executed into a Redis instance. * Checking the [latency]({{< relref "/operate/oss_and_stack/management/optimization/latency" >}}) of a Redis server in different ways. * Checking the scheduler latency of the local computer. diff --git a/content/develop/use/_index.md b/content/develop/use/_index.md deleted file mode 100644 index 33b9f80dbd..0000000000 --- a/content/develop/use/_index.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: A developer's guide to Redis -linkTitle: Use Redis -title: Use Redis -weight: 50 ---- diff --git a/content/develop/use/pipelining/pipeline_iops.png b/content/develop/use/pipelining/pipeline_iops.png deleted file mode 100644 index 858699ad0af6d0ed608d7d305970d75de67d1ebc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20207 zcmbWfc|4SF_&;hHOH@dK2kI|f>At50-cKzCwJ0v7z zI1&=ld}>PYB+tCJlZ1pO%SKuG)^%lNu3OHIRyKB)BqY~fyo;dH*0N!4Ky7rglb-l5 z?1Xo?h_UxEmDk6m{`>F9xhF6f1N$WzGTxx))M>l|Dko3VawR=~ZhntG*NpSE5=@_p zR_|6HmC!xwjk$$BL|ZF9E@pAaV$ke+F4$z7s8??4YD zp-T2Y#g!}jnT!vC;PijMy`!T=_qyx(!l{<^t&NeLjO3CZpHGu;A)X|ae2zW)q@DXm z69YAx1jbGJQ@j(BZxkeE{QT(irSJM7aZ^S5A@8SrTx;e!icrE;J-(TQt#5=+)^AJrVmJgRvDVRy z!|x&muHARsgcgq>1o>|lJff34+vxOPJIPt`*9sZeudOqSLmxgJAzLkRnVpi+7-y@f zj@6EQPBHn#xROQhE&W_UwcYR0!U_r94l>$s@^5(T3qjv+_#}Pv5Dhn4qhGA?^0r9v zv4HEaRmz%2A$Y911dG zO4{g{b6ApPgMDaD;8~_L*XVn+(BySJDcqvHWDWV1+bp=v;0>x0GU;EBeWSQoqsUy$ z0w9-k4A!>#JWiFIrIn)g%5$<&=NtcdMO@!Ep!HB8b9w9xd1@9o;q; zE~O%AHh`qF*v?%ec^@|P`nGAN%^52HEh>^onbTonepS!n@n1=J63OIVQ#HXjrb)=} zE7F?Lo(_9a>CZ_`_S;POm%q$w$P+H|`$&5(mhs0!W}Fwu18Z*IBG*8QCmu0^+^u$d z#J=W_`*nnsr1qC&6p5DEsQ|9iSC9{0Urr{o`ETnr|9y%+Wrx>vCrO?vhusqT7I@_r za{)(FU{KtL{TxC^R=#eN4f)EnF;nDS%3EUm*gX% zSTgIcvP&W*C$pbuetosXv?=AwdB)$gHvED=&j;2EI&VpvXeI(ylvNVVZ~gbvO8ZPY zMCV1iYGI<>ZI9dJX-+?_C75q2i~pc}U|7H>$J(ltnkbz_+hI9<%9Xc_+>b@!c{~i! za7!$R)$ir8XHSpRelx!$RvL9eooVv&?h(_L=9p8QDW#H8^}@Hls6V z&$aJ0nWJ|<5m@_uY|Y7C26~!3@>z2oM|IpcQ{8HFT_>DILujRPiv>s}o;>$WWf4=oyTbQDNpN{wQXCFVK zjUJrtckjR0FWE1~q1KayT$J4z4jjdx?h4 znw5^#^!~g1arcufJ({|k*T2Kx8uCnCU=fbw>*4Y+T?oFcHGET12_EVjzAa8s5D@?M z#?zxum1%lT)<*p-b(Vatfl77m#G1hd{ zQgy;}!hAw^;v&=gph_CePkIwyngmmhqF+Qe3R${~@o6*ZDCnr9t7@0)q;?f_1$2Gs zI`uRDGh>e zwX^MKHX5F;{KKi^`j5{)OH+fp3OjFhD5MP}QO!or)?wbw4*dxHBfRFdMfJxg(mcXI zbV4-CsNWGL_2|+y=`?XxiTkWutXAw&Y*iOK#e&58Eq>ap4fPJn{Md|IW@NNs6b-iv zXAbvB@lH97c1HVHofP-T7q)7(a*V`?2AjA)=u>uiUz&qGzUsc}$Q;4^U$A%ZMYUti z*P3aX;euuFP&&x2W412~^Zzi<26rde3)ywrwe@b>*qX(d`FwSEEnQ!ko@j`m>-*f7 zHy_e_tXF)VcOFs1`RJCLnY^}K#UpKxaXDSt5E+bIoqU|D_n6(BkgMY2_K&)H%W$AVk>ccd3;>BlO=R>9`iDw8T7zl7`#qZ-p6<5b&va36d;))tq#xl?wcyc1!GZHgp4 zPpVHEhb*XeL-LWO2E;z5c^nU!g#-r-D5r5}C_hwId{*|1`RVZ|Y)|cJ$~m&>+h`p_ zs#Ts`(N{@!b+Etptnfb#cAKuzpNMp;`V`89c++gA%b%K%Ylo!v6;6SMH z_xP9QDmqtgJ~EQQ$>x-X44N+s5PVuxkFE^xy z#R-qL8z87BGf$$wb$okv*7wf+PKqiCC~_n$Gqysp^lqYPBh%63-sCy8XnJqjj5{BG zN`7v&as4*u`oi@J^f@JZ9^H(FT0XfSYb;tAkE*hLJp3$<{pzJ5@leMrj^lQA?RQ%H zBP2_{+n~c*J0{aw=M8@rkK3^g&*T+au{#-lEgJdqDnIxO)Q)aw_)XH=d`atRs!+}u z=X1_aOY!n{9;XQmc;3Z^g*YpDy1DK6hSu_Tjx%Y*ghDw(gvP2-omW4$;%b_c^4JwEBQ(s#(`At&hjw1LNO%e% zxm~#Rai(rX?NTI-;fpNUEb&NjQO%+w{q;HDOxPZp_7KJ&_ICMj2+Eh`c$tf=GF|T6 z^Jn1?z(?;Q1%tCR*;_yg9+u7C@>fZm>W0^qI)$omEDf<-34H*)NZ+Gd>O)9L!CVH7d zRewR3D?;PLDM$)KNLmaeP0w;(`NI6>^R-Q0hH+{$adD?@<Zu$nLNc;tZIu#ZWmToaU8_i$X#a3Hrv1i=R@Wz|Yhqq=7ah5bzTz_;(8Y1EFpr+5QtUTq61Y&!qXpU%qjArcFWu zBe{M>N!ycjeu(y`osKcd(lH}a?k6X6t6v5pbE)Z@XoUImj#A%Ms-h?mdTFlntknO+ z8l~WMn%hB^Ma3liq0AXpP=z!NwI% zw#E9b_l1tc`z#{X=UlAfO1mTMAk_3+Fn()=zEuNiR)b`Yo4U6E6YYW%dB|&_%dX!gSXLdX{) zrfcA`*A{<1zxOFLf8pLAo56`mx;u7M&=Yo4j_=j($DE_wX>nglDZNspZ=Tz3L^Z1~ z^2%P{A~z@BUi6c$Nn*LSQl)M$+{CAv6(_5CxtP;5-8h7C|K#bpmMUNqE%4(dyoT^N z^2G|%(-nTgSgnUZsFFP z9fPV=#Mwe1xZxwaQh_Bwc%B;x!4_DOG_bXHs%uFOShv*;+llSpwAv<#^4kx)_94a^ z0z0m^x@ulH-Z!=#+s?lj`FJBXzPSav3dgOQV^{N>*<^(y(HK2hg(-VPo8`OJs|Ir( za?F-LTSwp;KJwKA#8fPFWugZwn=o5yP~8GA4A$P|-HejLSuDCd zg1p|dEvLD`nQ+>*J}*`}z8T{rG!@$8HTxD-Syi_(&(6~Yvg`;s>dnQ*Fi))b!y6)a4o-!Q7qrIUCm+d8#gGLYR1LN#DZ3+ek_#L zxD0K(4MdR>K6InEu3GREbqB`Xb_~GZ4$cVOlTF9t>RXS0pXnFZNqx!P7=MzphLHU7 ziTj?qDKk#HcUQ*vhVePdl95wS)+$fV-HmEsUsG80((HF>S3t{7 z#cGYqZ2o$T7BpE7a>aa#)Q#nSv3rCM0$@X2?!DLsn=^jRp-x50L&3Cq^;*AO*88ke zJ*rmYFj@&)+H&Ksl{>#!Hg~4$WONP;uNSSoa`fdL@|udX0nBB}Xq`B;M>RBS`7c#- zO)oMpdiRuf*3v;^Marf>Qm8JLjD-}`9+yv^%`VT5`eXX2aX+-j>L2|rFEb^rbSTq(x?8pK&L;e()OExPAL32Xu=niRyByzhalR|xF~ta6 zG5T|Ayn$21S@10hSmK(+e~f(tlsh*juY?3%W#AH{N5UhPsn_L?*31`=#1C&&Z7?Yj z!Zj76O;+ASCWHT0V!-y)W^+*R!2GkoE}7k+C_6UFrx3MJ#Hl5xt|0Bx*^o6AA{z!I z2Eo~n4bojRyo~`Ly%BnOSw|HE>kj~8avK{iCmMbJ7^P_gp<{IA81 ze%|4E6x23Bc7R`tVB#blf84R1QA38?zI?t2<4=D4T63hRrgfZ~ZofsSLgz8*!H(ZY zzXPkKcZG|QVnaeUykZ z^u&Op`+&VIM>sh4x75_5srM5l!ijo8$qit3YtV0F2z@Tn z=*=0wwI39!?Uz?uy59`AZ3irnG08*DUxCp>xye7U5lyz(b+YccyD#f!x-!sh@{6%j zBfhJn8kaM4vjo;Hgm-=ia+++vaj3I-Lru^63zeCZ-zn*U4eBeNQfQ6PA05?wzzOQX|+Z^>@b(DbgSdXx)18A6cv+_`$Nky_}L zRv23CuUd(DBay(Pq$QT5$6jj=y)9PeOb#pQ2|bz69VMy|V4(LgVnl;GmtnUQ~epcxNj>xDhl zrF@k3($IB&>C2p=k>TV7-^}e;DC8}g61!D^)({N989G)<8hc|tVfw5SZr(L^(*d?7 zIEeFS5FNP`*(-+UT+lOK%&3bTJ-2taizg%3&qwJk8583m>FaNS@zCtIPVnp8n$1ZN zDWCgNFct5UV%Z$QB)KK1-JACr!jNaYX6F$y**DJp^}D<$SsPp6sq2%`ThuFK zVdOiW+1^8+W3RPOjju8{$ArFX|Lig>m1WxgiVGUCj)$XbU^r{PPSpyf>=^{Jd9tJIPHtb&&D%@GBrAsw*C_Oh{*ke+6 zB3?^F_FNY5Jeb_t<7%^6#lv?}3(?y zetP!&X4}-;)yaYjyhST{lKh0Tu*3*|E);WQ%Pt-aC@8;JK?4@oRVn#XrwTsBX9QqP zn)K7-eYanVw_V#9@-Q9#qi*I-!P6M3DpVXC`06h_>7#6rNRhGVlb^Tk|LY2Twl0-z zP$)1Dc7*w%$|>AE#p(GA$$w_~v4IqsI8n$}&+e!aT}YxAnVb25dt5ygj&x-_Tr))! zz8s9HSZz~Fz|UEuc|$MX*$!}k;GOv5=Zglihgubp82UyfctN*1!S!Xd?g?U`h?F9& zA&@A=d(V7cn-E2mQg4fv{0b=W{xh?dez!86dW(0{BNQ)XS02vCRh>|A@dwXely(FH zTXigl^R@GBV0F}qiWpqIv%T7`Nq2b()^8bU98|rN<>;4Dje0rpXOjYg9pfYy-i=I^ z>8JUM3SXu+lX?Lkj(&I7L?1#(z_wU-$`3Dxto;au7c}Qv@`{}$B_+HzV^aH@C7f4< z<&H=(;|3n!X27+wpNJ2q*OTB z5Y0FVbcJ@MTqk@tDpRk70oMbAYunCHxcOHn(@-z*x!o@a{wodjr`5#Y2zVRhhxHhH z7|Vh01m}dK>QZf840b$^qPmj07t%#6YgbS?lwndv z6>-b82GS$GF8$`g!krrO^V);YR$uVNUlY{LyvA;qt5g^LhI)l zTy{r5bkfiQuk-o+KkWzq!Z(*Lox7icManJ=A$IWmibs2?k6z(w|JC3UU&As@_e7Wb zFA)7TZ~7w(7XDK|@v@I2B`QChclU$U z)f5mMQ?lx5rz=5ycwnCkqw1j3iH|!ChgTw8$HP=pl#k1vwJ+?_WwO4`bL+$fs?9LF z7aB(zb}c;2Oq)!kW1b8D|DxR{AaId3;3C_u(Dz6g;x2Ne}BeMI=X`6bpui*QRUj+Kl&*E&X~6E8zA; zE0(?%Yz+IPCWR`>*%$R$sf27Y4V7GzhTjr|>orS_ky$NU`}(`>Vpu{M1_Ic&i$18E zvnIHC!z$W#z->3Yksw43;2ytvCr*DlQgIKIubAlP?jFT2lrP4Ml#ahy1Cfb{jQ3=; zb;{-`psMcruN|zLfDUmE(T{6l%^oTe-6lQPE#_P+ROa&FEQsh+<2;6C?W?epb#b1$ zSq3_D4F&`dIbSA*r$DIh<&e}X7A~6GlE;Bv+|}4S;3P@u)F9ZqrhabyP7NGrVq~hD zZ4|AWsTZbkdHEZN8u*TtNY%a4=4u~p$k*Qv>&$q$YZO^4{iE?BEmHw!SoDB(*+H)Aj)Z;P|=AC6RKp_7Kk$Z&cL|i}7ND43b9Eds{{*%d`dzTIBH6E_s zMU__BaM9P~eoBP#(09y#WkyP-%=kz;{#1d-pp$Ap95;_HM&ajAS$~(i1NJh;pi~7z zB(DkZ?(IesB%7};dd+-J?F0aS7Z3JLeD?&YIF|RG?vdRS6Eh|Yz)#iB0?k!hmKl2~ z-noI=!Mg&r&60dGvejMOeIs1Vid2aZMFsn_r#ok9sn-+O-<1eF>!LD=x8jhdH$g8uJ)weC48_qxZnTaFOoC<>s=6(=O`$o@1|i=pq%{Z)=9;S3~eJV}5Xr-8b-fK>?#GecCmFn6m(dhw? zb^FK~<3P7TeuDK>(pMu)np~fnLTMbfRD;dQr?uU8QXB)4vuv056?mE}uQ};#S8(rK z_Yf`iiA>hLwH@!8q?^mhq*9&0iPygTeJWcokB4ZTFxBLA>ZV(rk>^W4=XXivWAi2B zy_I)Q>7}t5m+gAPaPaYC({60-e2U92)>_2dlLd1sE>%uS=3s7>jU#Es`?itH>0*D? z2gK}aM+zEpFV>FC>e^bNv{Zg1`U=InkO#&M+ond!IZiaa!+L`R|nL()*89E{#Z>0%yHY4E&*pRuP%qp+>C2Af0!PRuZs-p46YK(_qIu*9ZQ)#ws<={YJv}I3LUD z%0JzPXyBpBxmqkYdY(2nf77aa@_x8N+~v`z-hj*LQ$%m z`QMMdQza#9r;X}E44V_W>R3!;*TED5Pa_IgbTlxX`Vd^;8Se){eFS#L3Ma)J7Gs)m z*a$_balrTe%B3E!nH8dX@yY)sf4uFTIRc${tJQf^dgv`tnMr$kUynkzjnQ48Yi z7T{D|Z4nPPJs!f@|HX};tK%>t@UQ+wk=d6cW?bp*)(`3_#L9=s;0x=nbe%eQ<^*(m zsTTd6FTn`-wnA{8wqe(HqdW-pPbT0#vU^Wpc^gq%Ga2X*`GqJ46n?$Hd7`Pnye`Of z^aWo^xQ3j~i+m0duymMuAD?;PAQ#Q4M;l64{^pG*kZ`+hOwK=chYookW%|=zlH&Vl%VcXqSZ~3C#zG@6#w7t~RJPu4i@vSO@lLAmemK^`(Bi>U@_F6MlXOy8mE&v1uLs6GkX3tu z5~C2YG!+ZdB|&4iE*;tsI}oN~$T>G*-aELF1e2uz79pALX$~YjDbRH4Z!}7R{0?FO z#FqwZXG7~a!g$E5h&}f!ey*eay`MPF-tj3Y1TYu(Zcj?1qT@l3I656{vi7k6zdn!( zsvza`eKT;4VypB|iWy2myT{1orrbTTc}J}Lmb4Q<6f>yX{Bn_I?J!`ak77o` z%?J9$aiw3XUnG`P)a9)g$S4w>kF(#hQCGxz#kwGbrz14W-nZxM*54u*(chcBC6gsA zoGZ$5la4=KpsKRm$fRlwdItR$I#rJhJuic7y<)YB+cSgjxo-*fE?#*P&CM++ej1@k{JJ4`=#KU3rL+fE(j@Y)wG@UDZ zmT+42ZylrAbIYc}rGbm9gOj{WU|)xlSm@_MhkYv~!3Jk@-1k924K$PY+Zi7nGJGB# zl5#JDfL!J0>gD{jE;Abh8`<|*TpbrkYv7E}&|HIWb{I+Kw3 zG8w-AnDRW>73)M4&7}ZLgMuCHXO3^`;vR94k%xm;nu#di=a*m z+QTh%O9-IhUVle(e;*KPA<&l<{T1~lPVcLQF5(8In)trp#u&jK+f7;z;tt3&0k92$ zoUi+DK&W48g6}B$NbZ?_@G5IM_(WQT@`XWfJa?kNn|(CKfIan{zFT?N5`GQZe2_!p zR@#8nO>)~K?GmpdiuRAF9`rdlar6)N$PnZ5-_+FWfn(`={Wu~7Er`ks08$OpwtnJSJb6uJKO?_`L|w?1Y#YwFy-= zQL-(W?lZk~@|A;>Ifq-O_cTe=&E46y`Aj{-TM{ZvwYFS#dWlY6VaE2G)e%kJXZn2m zFF$6UmhI(qRer1b4`*f+5r6I&dDT}%uBy6e6y#S-IPx^vFz)nc628%eQSNV?lE33j z?YdS`G#Tv&`ey{34aJ!4LPDutHotrX zY9?wXJGv|3i$~n#K3~sxLA)!U8;$?%n)TsR(U3~o2b!{dHR9?>h0TKwOlCVK_{caH zV!g^vKeK1wibJT6UI#Kh+iOrqvtsM?UHyQmIMALNl062E?A!j$o`KvGc83^H`&vpP zkNxw6ya#@Ob3?Cuwyi`JhTj)zG$=c?&vneO?r#K!2FB$kf@&JN|D?KwhI-xF{ejzF z+7GIl7ywA8D)P)8&eW>1{V#}vu4e+4yIX0`!jK?Sz`_{0m92v?R zYPmMAtu8{lb7sE+Lhq>o%U#UccTND1SBb<}^#HM3y8G769~J{xJN8XvpLr6bK0_J@ z(8~9p+Ctr*T+8Wy7H6W9x}T*1&TbO5R<%P>T3UMN0@X5BPgeL5@MX*75013|t20(Q zKr=@|=#dCJF#gdK7C}z9m#XUbPumodPO(L^o)P@^#y<9dtvE|9lrix9vMuM-L^Qt4 z@}&TxGz;A^e7iI)@ZeaSDf%sX;RXisy`of`6P9v#33IFVLKB2lpl-wdVWPQi$@eBa z)0mKofJTi=v>zNj*=K;!S=)=}-PU@O!0o1t( zHoIRl0r-*wEuMO<)c?E=-~{aRD;a-=QZr_X1aSJ)yT332loCL|EBN>QW)65+l9BO#)vXlCqwxyd3jEkS$I57Eu z*Z+v+ov-Mgxe0&8^(NAtTy#c1&w(=o@RcM}pujPFYp6X41i`9t8lbEND|UWZw;|`N zVJJNLb>CUDe-88eUngjv#WY77f&1Y8kD2*F^OI&>b)bM?%RUpx2+j!M|Mmdzxe+j* zqXX^gh%8B5oInuegvD|!yUg5L;r+7*Ru70u^cJYFovu(lBAeEp0}5l=+zDE3@{QZ2 zXZ}%lYN3(P#kX%;9m*;o(zfGNcv0q&jtQ(m<1dV_US$G>RPve($nx zPas!8Ce3-VWai)j^~)Oo`~o(A4q0N&191BGEB&7n5CGUoOYZsyh~EHE7#?T*1C%r% zZMRQDFH*CkwhuV705}OfVp4eU0P>88lcL;}Lj&@X=)(VrVSz;kRT<|(^q^xakwe(5 z9`$1IJTm_*5TaQ-Jy&dT1qSWe`u%ym8s3YUpJ$z}3U;At`n+E-CPDt7SvxuBK{K6% zneYeQ#o8O3!teSIIaZH^&6}Z4S8LwATew$1Cw@8~64C1HF@QoocjWkI-gDQzrDhdc zt+&o>D9;=1?~#-&i78DX-;|Ji5mSST-u_V){qsPXJ5WI53`0<}5hk`)P=U74vy8Q(19*J$ObqlwaA$| z5V$z-Qva0GfR+0HO(y4*87kiJ)1k>TYXVBCC1v*hARdGz8Ujr!zO!=R59y;W0quT! zEb1U2r>39Q1%c(issKqLrhk^?DgP)<89fo74<8Agy8e=g*%!Wl^&P;#rzfZXF+%_METM$P zdt91NnH+#iy%ccOM0IQRkSkYUay;II9RLGn)#OHP1IeY}#0l31F z`-jN;KM>+Hf-4kv$6P(22F6tA=cb%iW=r+Iitp=1^-B;!S>NY!dwd`{SUIo)#^3gO zd%$ZT*+4GU-Uyqa++Rh4bO(xhSn~vH#fknX4EgieA*b_TgYFEtL%CWJ-4QSOXZFKK z{XhlhdDaiX*z(-pY$Ru@tiZKx7 z-a*|0x}0+->`*DpC?W4T=5T)o**s}y$@Y&5#)q_`!hHbD%U4P#|9@3OU?3I!-yhf= zSYkMEREW54l`QNJlLyIn?Q1o1(zOmlD{w0S1bw^@5^Rk--g8cHDFVP!EaakN6#cjU z2bC-{lomJ08poEExTv;kH5PxK`6ub1PSzIe4TTLKZqC2jm0D=FFnU5CXVT2N?uBK4 zW)w;%_%D)@Y5wYDes>Ez`@tzP{9t!TyVJ!yM*+DNnS)ak!;=+Sucz{NNQXo5j<*!{ z&r{;&Zpw%Pt5adnQ*YUCw~5cKr5vju9EMA2ydCHkcxk})cV4P>FX$ATyLWcO0hEDU zXo)6g9=ZMXWA~tYzJl<&e4KRJTDsh)Luo%KgJoG>zS+=;I0P#CEWmEck51jgN1*G8 zJM4M_^oZRgYdyL?WPx};oYa4iPIn~1#2@3&?Dwxq=(KBA`Wm&iW^^(YEN5B}XI3{Lfd-B`b z7O|HN#fC$p+n_t!t}Ea9QhgRm`TS9#HiUysV*8s^+897yQ^Ps&$996o>7yIaI zffm7?Xxu)GUi4u+6ItDf22q=Uxy@ z9@S73#=wcQF<|V|?E5NlY;kQ2N*Gh<%Dewt;l2#9;W-uxjVH{a2!b5m(;qNkZqCbq zZ{dr~v-zi@zW2O|)1+Tl0ADwWO(0_1R^nNNkjccCIy(7%fkYigf|*XKdC;Cw>Ckal zJ|AOu35EMjhmawTP+|r~2<}^dOn3gAoUKar3SL)5%{n-lNc)Ad&28RVs)cUXx@E9> z67=L&HFwrDF~oTjQ9q0tl?fb5amMZEZ4BqmGAEkYA57Ks9c9Fylw5M5z>)LmaP6wQ zmtSkFV6MO)_&u3im_pBCc@Bx{~;VdYYI(acFkU= z5cO2r!Y1rs-wyQ3PEChOII@Lu{yc>*SAX>vH6U1O1M~dm_M2c(E()|!b6i^`dy*5d z(Fxay4a%VS?Ew_t(3?1!LcpPRK(qjzA3B1%MOf-dJ7{hdZp9Q?CNY*GJ20aamc_WUTk z{2)OX(UoDMlic8q-%LbTjq~{?aX5OTV>;Eq?Sj#Pw~g$az8~kExb5wR*0KibRbQXs zOdpkds$pnU%rF4vp5unWzy@>kL&eP+I*~>=xD}DQSwGt92zLo`3cggk5+s-%)y^{2 z5akG3(kf8m4GR{_%6WUon07RQN3lhPozKDc*l>%z@VK7;-Ju)}OjqfrJ#(wY(^0lr zw7COqAjOtSqRVyZi1TUV_N~*|ZkbHeZFRC)(SNWOS<%0E5Vl3d*Klj8P~*AcfKBY> z<&R8UZT4UiWz}ZUvq66HV?_nAGwzZ_N9~f82<2-nB-<#}eJzLL6g8;94+0oU_iR17 zU691&+NPpEF;ASM>+hgRYyNIrsR*XMCJodyBU*fhy{4Gl3KV078q2}7e>)yDsGY-@ zDZ%7rjO~yMJiGAar^b;j%4C@$?GfgaW#8JsB@4Npt;s}-><1RMr9TFj8#ti}segoP zjb=~1!s5H1R;u6#6Q%@9#jHPBb%VA*k4mL0eji)4fv)gE@4TGw{cl!fb|8Lqu)A1x zVjSC(k zRs9%zH7^@#GL;omRre-F$v%tjG=_K`XloU^vpTwH9dqZ1Um~zI~Mtb?~E%SW2(Ar9{O?- z$E|L8zJor0*Zh1!Ht(oF_ds!#%5`vc2Vn@A&l|r`#5&Sz{-PUqd&O|zF>86s)&*dsF*Gz#~(d<}b6!EHp zJj^}3x}E;gLRih|+Qp9UEw6(M~SdMS(}WZ#6gr=UC7(SY_5 zY}^Qc1WBC`0zv>6fJ6hfsJ9Jm>w;aH^Xm~yRES$YH;{C`i6vq({meE_H4gDAArnf= zv{?Z93*IjHKRqm*JV9T*H+i>C=MOF;d756*$$%;7R^RKU*rvNd@Cn1~CUERT-JPV8 z$2YO;&#{bh71Jq>92&-gvLXT@!ir{3op8)b-Y*fSacC$WZLa_0?_fI?OZAOMZ|8Hu z*5{MmdD?vSD6it}x}+&6)~-Jp?>YLS zbOcv95@SoTsxsXDey228w8~S&lw{B#6w1OfT`vpFv~9g-RZF+A?G zlR&^=$DDrH3qFX2o)I-bjvCo|X*z}37RZWRdPVEE2>dkGH;a=rCisg>%*Qrxx2*I+ zaU`v)Va=@3?1Jp-d=RaEv!M}n48E!T$4Kue*^qC|BcrG?>|_iJCTrq)ombX5wK}-8 zpWr2TY=aUNhxX4dnxBI04~A5%v)w!ru|*BDtL;#P(r~vlxl7hSO52o;U)pD4h4o(ZZ3E7)&YiFX7j|!c*EpHaI@Rj-UL1EV zdkhl38U|NdrK9BbO0GvuxVjx0-h`F3TDELQ7ME0uTV;WuVUcCSBvf+KY4&?b0=$bk zzj66_->Qa}xx&^CVR46f1JN%2W8Sh*@meyt?{reUWx|oFfAwZR*vV{4EAhTV5F0@c zHL{f(Zs5_O-z+X-cf7$fgf^+!cD32(w)D zbnOs*^U1})&2>HpdAXPNKYHC?(8PcW`C6o>yv$zG?#g@X_WNd-_sn)HECn0d)@S-|n>#=Tl7>gy6s+UDtd@i8mzztMZ`LL|Sgjx4iuhaK zRO3SAW*U90dU9)OgxzHHO5kBG4DJSj)bxI6X!l|MGEJQL6pv#(d`q2Jkp9x3I(wMo zt`SSd(QPjd5)R0D!$jGdDxW#cb@|(eFH(whXyqn2?x2U?JAEoHu0728Ny+%Tj<2)O zPLB;I%r{sdqA-+B1!NcF=PfSxGq*U{+XYG&+4UXQH1j;?GjhBkV)l_yl6FyT{(R~< zD1#g|?`qv{#!L{)v3S?Pe@Zh}#-L|u$~4_B_nL6HsVH5fCAxpfp`T+!NT|1egXMIA zma3WXfE-_Qc^b)pir1E0W07c;il$Zh1x-_`zV*7E<@?zjHd~6-MUG#QRBxHfNJz-D zh<^)!8FVZViIRc`oo`UT_(0P#-cmJjRoSoo!a-Th>;{DLQa-dP*m*32yJq`sMfvU> zK;kKyW&XV$Ug}_YtB^9o*E<#F+lv`0GF3cG5O1CUJrC(4S55yBM0qtVVp&~2VErJ? zr;kzr5)=waS3KP815kjdJa#CombB^?Dx3}rQ~R{u@k+yc(VX+|oE%s%_Nb;jfvn=r z7%yFTyRNM6CrPc(#U}alt@e5Oa+Q3uDWbZnjG;PMubtzQakngE)UxGt-$ktYm|VDJ z$z+4g6Y~)096*~RQXb>0pO;hU+|#*tZC2>DaBcpO1n1abUrrCNozFW%7nAkXs`>W3 z8M`7K0sJSoEolkEV$Q|4!=_+xdCt9f`d-nhqcUR5*s@&jMPKEDSMWR8jE3}=UrdKK z=36LnY-fid^EH^vs*CkMMB5%~Iqn3vx<4u^P2Mc#k}A@_ztnE$BQ9M2PVGW!z&lr;ixv}P;acq-CSt%;&bk`R%p;; zRZBTfwDXGzk_0#X6jaZA#5@lFZo!T$iD9XVqe2{A6BD5}H?bqp?Aa7xA}a7pbm`+| zKaQgVp5G!8Z~`6QiRzY{=D&kxp1{l|?x43u**Cw7v(H7M%-31Uc0dlT+=d@`b`O5V zW?2pz=wlbR9sHP(Cj86KFeY=BvDf`(mrlJ#d|YR_fObmAPKxvVPAkJREW@X|+3mTV zf&lYh2%$e!#;Nb_wO%+{G4uVxt=AG!PK^kq=1=cN(+5edZ{4Y*npt%45 diff --git a/content/develop/using-commands/_index.md b/content/develop/using-commands/_index.md new file mode 100644 index 0000000000..dea086ad11 --- /dev/null +++ b/content/develop/using-commands/_index.md @@ -0,0 +1,71 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Learn how to interact with Redis using commands. +linkTitle: Using commands +title: Using Redis commands +weight: 33 +--- + +Client applications and tools interact with Redis using commands. Most of the +commands implement [data types]({{< relref "/develop/data-types" >}}) to store and retrieve data, +but there are also commands that deal with server configuration, security, and more. + +The sections below give an overview of how Redis commands operate. See the +[Redis commands reference]({{< relref "/commands" >}}) for a complete list of commands. + +## Command structure + +Each command is identified by a unique name. Related groups of commands +tend to follow a consistent naming convention. For example, all commands that +deal with [hashes]({{< relref "/develop/data-types/hashes" >}}) start with the `H` prefix. +Most commands receive one or more arguments that specify the data to operate on. +For data type commands, the first argument is usually the [key]({{< relref "/develop/using-commands/keyspace" >}}) that identifies the target data object. + +After you issue a command, the server attempts to process it and then returns +a response. Commands that update data typically return a status message (such as `OK`) +or a number that indicates the number of items changed or updated. Commands that +retrieve data return the requested data. An unsuccessful command returns an +error message that describes the problem. + +Interacting with a Redis server involves a sequence of commands and responses. +The effect of a given command is the same regardless of whether you send it +from a [client library]({{< relref "/develop/clients" >}}), or from a client tool +such as [redis-cli]({{< relref "/develop/tools/cli" >}}) or +[Redis Insight]({{< relref "/develop/tools/insight" >}}). This is very useful +during development. You can use a high-level tool to experiment with a +command, set up test data, or prototype a data model, and then access the +prepared data from your application code. Most Redis code examples are +presented with an excerpt of a CLI session and the equivalent application code +for each client library. + +## Batching commands + +Although you can issue Redis commands one at a time, it's often more efficient +to batch a sequence of related commands together into a *pipeline*. A pipeline +sends several commands to the server as a single communication and receives +the responses in the same way. See +[Pipelining]({{< relref "/develop/using-commands/pipelining" >}}) for a full +description of the technique and see also the pipelining examples for the +[client libraries]({{< relref "/develop/clients" >}}). + +Another reason to batch commands is to treat them as an uninterrupted unit. +You should do this if you need to be sure that the commands are all +completed without the same data being modified by another client (which +could leave the data in an inconsistent state). Redis uses *transactions* +to implement this behavior. See +[Transactions]({{< relref "/develop/using-commands/transactions" >}}) for +more information and see also the transaction examples for the +[client libraries]({{< relref "/develop/clients" >}}). + +## More information + +The other pages in this section describe Redis command concepts in more detail: diff --git a/content/develop/use/keyspace.md b/content/develop/using-commands/keyspace.md similarity index 64% rename from content/develop/use/keyspace.md rename to content/develop/using-commands/keyspace.md index 9b691f229d..a06b8b03f8 100644 --- a/content/develop/use/keyspace.md +++ b/content/develop/using-commands/keyspace.md @@ -13,18 +13,37 @@ description: 'Managing keys in Redis: Key expiration, scanning, altering and que the key space ' -linkTitle: Keyspace -title: Keyspace -weight: 1 +linkTitle: Keys and values +title: Keys and values +weight: 10 +aliases: /develop/use/keyspace --- -Redis keys are binary safe; this means that you can use any binary sequence as a -key, from a string like "foo" to the content of a JPEG file. -The empty string is also a valid key. +Every data object that you store in a Redis database has its own unique +*key*. The key is a string that you pass to Redis commands to +retrieve the corresponding object or modify its data. The data object associated with a +particular key is known as the *value* and the two together are known as +as *key-value pair*. -A few other rules about keys: +## Content of keys -* Very long keys are not a good idea. For instance a key of 1024 bytes is a bad +A key is typically a textual name that has some meaning within your +data model. Unlike variable names in a programming language, Redis keys have few +restrictions on their format, so keys with whitespace or punctuation characters +are mostly fine (for example, "1st Attempt", or "% of price in $"). Redis doesn't +support namespaces or other categories for keys, so you must take care to avoid +name collisions. However, there is a convention for using the colon ":" +character to split keys into sections (for example, "person:1", "person:2", +"office:London", "office:NewYork:1"). You can use this as a simple way to collect +keys together into categories. + +Although keys are usually textual, Redis actually implements *binary-safe* keys, +so you can use any sequence of bytes as a valid key, such as a JPEG file or +a struct value from your app. The empty string is also a valid key in Redis. + +There are also a few other things to bear in mind about keys: + +* Very long keys are not a good idea. For instance, a key of 1024 bytes is a bad idea not only memory-wise, but also because the lookup of the key in the dataset may require several costly key-comparisons. Even when the task at hand is to match the existence of a large value, hashing it (for example @@ -40,6 +59,49 @@ A few other rules about keys: fields, as in "comment:4321:reply.to" or "comment:4321:reply-to". * The maximum allowed key size is 512 MB. +### Hashtags + +Redis uses [hashing](https://en.wikipedia.org/wiki/Hash_table) to retrieve the +value associated with a key in a highly efficient way. Hashing involves combining the +raw byte values from the key to produce an integer *index* number. The index is then +used to locate the *hash slot* where the value for the key is stored. + +Normally, the whole key is used to calculate the hash index, but there are some +situations where you need to hash only a part of the key. You can select the +section of the key you want to hash using a pair of curly braces `{...}` to create +a *hashtag*. For example, the keys `person:1` and `person:2` produce different +hash indices but `{person}:1` and `{person}:2` produce the same index because +only the `person` hashtag section in the braces is used for the hash calculation. + +A common use of hashtags is to allow +[multi-key operations]({{< relref "/operate/rs/databases/durability-ha/clustering" >}}) +with a *clustered* database (see +[Database clustering]({{< relref "/operate/rs/databases/durability-ha/clustering#multikey-operations" >}}) +for more information). Redis doesn't allow most multi-key operations in a clustered database +unless all the keys produce the same hash index. For example, the +[SINTER]({{< relref "/commands/sinter" >}}) +command finds the [intersection](https://en.wikipedia.org/wiki/Intersection_(set_theory)) +of two different [set]({{< relref "/develop/data-types/sets" >}}) values. +This means that the command + +```bash +SINTER group:1 group:2 +``` + +won't work with a clustered database but + +```bash +SINTER {group}:1 {group}:2 +``` + +will work because the hashtag ensures the two keys produce the same hash index. + +Note that although hashtags are useful in certain cases, you shouldn't make +a habit of using them generally. If you have too many keys mapped to the same +hash slot then this will eventually harm the performance of your database. +See [Database clustering]({{< relref "/operate/rs/databases/durability-ha/clustering" >}}) +for more information about how to use hashtags. + ## Altering and querying the key space There are commands that are not defined on particular types, but are useful @@ -120,6 +182,7 @@ the [`PTTL`]({{< relref "/commands/pttl" >}}) commands, and the full list of [`S ## Navigating the keyspace ### Scan + To incrementally iterate over the keys in a Redis database in an efficient manner, you can use the [`SCAN`]({{< relref "/commands/scan" >}}) command. Since [`SCAN`]({{< relref "/commands/scan" >}}) allows for incremental iteration, returning only a small number of elements per call, it can be used in production without the downside of commands like [`KEYS`]({{< relref "/commands/keys" >}}) or [`SMEMBERS`]({{< relref "/commands/smembers" >}}) that may block the server for a long time (even several seconds) when called against big collections of keys or elements. @@ -139,7 +202,7 @@ This command is intended for debugging and special operations, such as changing your keyspace layout. Don't use [`KEYS`]({{< relref "/commands/keys" >}}) in your regular application code. If you're looking for a way to find keys in a subset of your keyspace, consider -using [`SCAN`]({{< relref "/commands/scan" >}}) or [sets][tdts]. +using [`SCAN`]({{< relref "/commands/scan" >}}) or [sets]({{< relref "/develop/data-types/sets" >}}). [tdts]: /develop/data-types#sets diff --git a/content/develop/use/pipelining/index.md b/content/develop/using-commands/pipelining.md similarity index 98% rename from content/develop/use/pipelining/index.md rename to content/develop/using-commands/pipelining.md index d4acef2bc5..706a16c793 100644 --- a/content/develop/use/pipelining/index.md +++ b/content/develop/using-commands/pipelining.md @@ -12,7 +12,8 @@ categories: description: How to optimize round-trip times by batching Redis commands linkTitle: Pipelining title: Redis pipelining -weight: 2 +aliases: /develop/use/pipelining +weight: 20 --- Redis pipelining is a technique for improving performance by issuing multiple commands at once without waiting for the response to each individual command. Pipelining is supported by most Redis clients. This document describes the problem that pipelining is designed to solve and how pipelining works in Redis. @@ -100,7 +101,7 @@ call. Consequently, the number of total queries performed per second initially increases almost linearly with longer pipelines, and eventually reaches 10 times the baseline obtained without pipelining, as shown in this figure. -![Pipeline size and IOPs](pipeline_iops.png) +{{< image filename="/images/dev/reference/pipeline_iops.webp" alt="Pipeline size and IOPs" >}} ## A real world code example diff --git a/content/develop/interact/transactions.md b/content/develop/using-commands/transactions.md similarity index 99% rename from content/develop/interact/transactions.md rename to content/develop/using-commands/transactions.md index 4321ca0b7c..c0c9aff063 100644 --- a/content/develop/interact/transactions.md +++ b/content/develop/using-commands/transactions.md @@ -9,6 +9,7 @@ categories: - oss - kubernetes - clients +- aliases: /develop/interact/transactions description: How transactions work in Redis linkTitle: Transactions title: Transactions diff --git a/content/embeds/r7.2-breaking-changes.md b/content/embeds/r7.2-breaking-changes.md index c2206103f6..c4039685c7 100644 --- a/content/embeds/r7.2-breaking-changes.md +++ b/content/embeds/r7.2-breaking-changes.md @@ -19,7 +19,7 @@ Upgrading to Redis version 7.2 from version 7.0 introduces the following potenti - Time sampling is now frozen during command execution and scripts ([#10300](https://github.com/redis/redis/pull/10300)). While a command or script is running, the keys used by the command or script will not expire. This breaks any script that uses a loop to wait for a key to expire. -- Blocked commands in scripts now work the same way as when they are used in [transactions]({{< relref "/develop/interact/transactions" >}}) ([#11568](https://github.com/redis/redis/pull/11568)). +- Blocked commands in scripts now work the same way as when they are used in [transactions]({{< relref "develop/using-commands/transactions" >}}) ([#11568](https://github.com/redis/redis/pull/11568)). ##### Error handling diff --git a/content/embeds/r7.2-combined-breaking-changes.md b/content/embeds/r7.2-combined-breaking-changes.md index d5b634b70c..8f835e232c 100644 --- a/content/embeds/r7.2-combined-breaking-changes.md +++ b/content/embeds/r7.2-combined-breaking-changes.md @@ -28,7 +28,7 @@ Upgrading to open source Redis version 7.2 from version 6.2 introduces the follo - Time sampling is now frozen during command execution and scripts ([#10300](https://github.com/redis/redis/pull/10300)). While a command or script is running, the keys used by the command or script will not expire. This breaks any script that uses a loop to wait for a key to expire. -- Blocked commands in scripts now work the same way as when they are used in [transactions]({{< relref "/develop/interact/transactions" >}}) ([#11568](https://github.com/redis/redis/pull/11568)). +- Blocked commands in scripts now work the same way as when they are used in [transactions]({{< relref "develop/using-commands/transactions" >}}) ([#11568](https://github.com/redis/redis/pull/11568)). ##### Error handling diff --git a/content/get-started/_index.md b/content/get-started/_index.md index 73f0dfac91..d9af518244 100644 --- a/content/get-started/_index.md +++ b/content/get-started/_index.md @@ -29,7 +29,7 @@ The following quick start guides will show you how to use Redis for the followin ## Data integration tools, libraries, and frameworks - [Client API libraries]({{< relref "/develop/clients" >}}) - [Redis Data Integration]({{< relref "/integrate/redis-data-integration/" >}}) -- [Redis vector library for Python]({{< relref "/integrate/redisvl/" >}}) +- [Redis vector library for Python]({{< relref "/develop/ai/redisvl/" >}}) - [Redis Cloud with Amazon Bedrock]({{< relref "/integrate/amazon-bedrock/" >}}) - [Object-mapping for .NET]({{< relref "/integrate/redisom-for-net/" >}}) - [Spring Data Redis for Java]({{< relref "/integrate/spring-framework-cache/" >}}) diff --git a/content/glossary/_index.md b/content/glossary/_index.md index 7c6f902606..5dc5dc5aa8 100644 --- a/content/glossary/_index.md +++ b/content/glossary/_index.md @@ -102,13 +102,13 @@ More info: [Database clustering]({{}}) that acts as a single repository for all [cluster]({{}}) metadata. -More info: [Redis Enterprise cluster architecture]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}) {{%/definition%}} {{%definition "Cluster Node Manager (CNM)"%}} A collection of Redis Enterprise services responsible for [provisioning]({{}}), [migration]({{}}), monitoring, [re-sharding]({{}}), [rebalancing]({{}}), de-provisioning, auto-scaling. -More info: [Redis Enterprise cluster architecture]({{}}), [Database operations]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}), [Database operations]({{}}) {{%/definition%}} {{%definition "conflict-free replicated databases (CRDB)"%}} @@ -262,7 +262,7 @@ More info: [Latency monitoring]({{}}) that operates as the leader of a [cluster]({{}}). Also known as the primary node. -More info: [Redis Enterprise cluster architecture]({{}}), [High availability]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}), [High availability]({{}}) {{%/definition%}} {{%definition "migration"%}} @@ -327,7 +327,7 @@ More info: [operator pattern](https://kubernetes.io/docs/concepts/extend-kuberne {{%definition "Out-of-Memory (OOM)"%}} If a member [Active-Active database]({{}}) is in an out of memory situation, that member is marked “inconsistent” by Redis Enterprise Software, the member stops responding to user traffic, and the [syncer]({{}}) initiates full reconciliation with other peers in the Active-Active database. -More info: [Active-Active database troubleshooting]({{}}), [Memory management]({{}}) +More info: [Active-Active database troubleshooting]({{}}), [Memory management]({{}}) {{%/definition%}} ## P - Q {#letter-p} @@ -377,7 +377,7 @@ For more info, see [Proxy policy]({{}}) provisioned only for [cluster]({{}}) operations that can be elected as a [master node]({{}}). The quorum node participates in the cluster quorum and must be explicitly assigned this role via the `rladmin` command. -More info: [Redis Enterprise cluster architecture]({{}}), [rladmin command reference]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}), [rladmin command reference]({{}}) {{%/definition%}} ## R {#letter-r} @@ -421,7 +421,7 @@ More info: [Redis Cloud]({{}}), [Redis Cloud quick start]( {{%definition "Redis Enterprise cluster"%}} Collection of [Redis Enterprise nodes]({{}}). A [cluster]({{}}) pools system resources across nodes in the cluster and supports multi-tenant [database]({{}}) instances. -More info: [Redis Enterprise cluster architecture]({{}}), [Cluster management]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}), [Cluster management]({{}}) {{%/definition%}} {{%definition "Redis Enterprise database"%}} @@ -433,7 +433,7 @@ More info: [Database operations]({{}}), [Create {{%definition "Redis Enterprise nodes"%}} Physical or virtual machines or containers that runs a collection of Redis Enterprise services within a [cluster]({{}}). -More info: [Redis Enterprise cluster architecture]({{}}), [Install and setup]({{}}) +More info: [Redis Enterprise cluster architecture]({{}}), [Install and setup]({{}}) {{%/definition%}} {{%definition "Redis Enterprise Software"%}} diff --git a/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-mysql.md b/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-mysql.md index 9df6c5cb0d..7e95a35ffd 100644 --- a/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-mysql.md +++ b/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-mysql.md @@ -37,7 +37,7 @@ You can also create one during database creation by selecting **Create an Aurora RDI requires some changes to database parameters. On AWS Aurora, you change these parameters via a parameter group. -1. In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/),navigate to **Parameter groups > Create parameter group**. [Create a parameter group](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.CreatingCluster.html) with the following settings: +1. In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/),navigate to **Parameter groups > Create parameter group**. [Create a parameter group](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.Creating.html) with the following settings: | Name | Value | | :-- | :-- | @@ -64,6 +64,9 @@ RDI requires some changes to database parameters. On AWS Aurora, you change thes Select **Save changes** to apply the parameter group to the new database. +1. Reboot your database instance. See [Rebooting a DB instance within an Aurora cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-reboot-db-instance.html) for more information. + + {{< embed-md "aur-rds-mysql-create-debezium-user.md" >}} -tab-sep- @@ -72,7 +75,7 @@ RDI requires some changes to database parameters. On AWS Aurora, you change thes RDI requires some changes to database parameters. On AWS RDS, you change these parameters via a parameter group. -1. In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/),navigate to **Parameter groups > Create parameter group**. [Create a parameter group](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.CreatingCluster.html) with the following settings: +1. In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/),navigate to **Parameter groups > Create parameter group**. [Create a parameter group](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.Creating.html) with the following settings: | Name | Value | | :-- | :-- | @@ -96,6 +99,8 @@ RDI requires some changes to database parameters. On AWS RDS, you change these p Select **Save changes** to apply the parameter group to the new database. +1. Reboot your database instance. See [Rebooting a DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RebootInstance.html) for more information. + {{< embed-md "aur-rds-mysql-create-debezium-user.md" >}} {{< /multitabs >}} diff --git a/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-pgsql.md b/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-pgsql.md index ec2dee5207..ff4a89d0c3 100644 --- a/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-pgsql.md +++ b/content/integrate/redis-data-integration/data-pipelines/prepare-dbs/aws-aurora-rds/aws-aur-pgsql.md @@ -50,6 +50,8 @@ RDI requires some changes to database parameters. On AWS RDS and AWS Aurora, you Select **Save changes** to apply the parameter group to your database. +1. Reboot your database instance. See [Rebooting a DB instance within an Aurora cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-reboot-db-instance.html) or [Rebooting a DB instance (RDS)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RebootInstance.html) for more information. + ## Create Debezium user The Debezium connector needs a user account to connect to PostgreSQL. This diff --git a/content/integrate/redisvl/_index.md b/content/integrate/redisvl/_index.md index 2e3e1a4ba2..dd22711c32 100644 --- a/content/integrate/redisvl/_index.md +++ b/content/integrate/redisvl/_index.md @@ -35,12 +35,5 @@ title: RedisVL type: integration weight: 1 --- -RedisVL is a powerful, dedicated Python client library for Redis that enables seamless integration and management of high-dimensional vector data. -Built to support machine learning and artificial intelligence workflows, RedisVL simplifies the process of storing, searching, and analyzing vector embeddings, which are commonly used for tasks like recommendation systems, semantic search, and anomaly detection. -Key features of RedisVL include: - -- Vector Similarity Search: Efficiently find nearest neighbors in high-dimensional spaces using algorithms like HNSW (Hierarchical Navigable Small World). -- Integration with AI Frameworks: RedisVL works seamlessly with popular frameworks such as TensorFlow, PyTorch, and Hugging Face, making it easy to deploy AI models. -- Scalable and Fast: Leveraging Redis's in-memory architecture, RedisVL provides low-latency access to vector data, even at scale. -- By bridging the gap between data storage and AI model deployment, RedisVL empowers developers to build intelligent, real-time applications with minimal infrastructure complexity. +This content has been [moved]({{< relref "/develop/ai/redisvl/" >}}). \ No newline at end of file diff --git a/content/integrate/write-behind/quickstart/write-behind-guide.md b/content/integrate/write-behind/quickstart/write-behind-guide.md index eaeaf58030..f2e25936ad 100644 --- a/content/integrate/write-behind/quickstart/write-behind-guide.md +++ b/content/integrate/write-behind/quickstart/write-behind-guide.md @@ -158,7 +158,7 @@ The `redis` section is common for every pipeline initiated by an event in Redis, - The `row_format` attribute can be used with the value `full` to receive both the `before` and `after` sections of the payload. Note that for write-behind events the `before` value of the key is never provided. - > Note: Write-behind does not support the [`expired`]({{< relref "/develop/use/keyspace-notifications" >}}#events-generated-by-different-commands) event. Therefore, keys that are expired in Redis will not be deleted from the target database automatically. + > Note: Write-behind does not support the [`expired`]({{< relref "/develop/pubsub/keyspace-notifications" >}}#events-generated-by-different-commands) event. Therefore, keys that are expired in Redis will not be deleted from the target database automatically. > Notes: The `redis` attribute is a breaking change replacing the `keyspace` attribute. The `key_pattern` attribute replaces the `pattern` attribute. The `exclude_commands` attributes replaces the `exclude-commands` attribute. If you upgrade to version 0.105 and beyond, you must edit your existing jobs and redeploy them. ### Output section diff --git a/content/operate/_index.md b/content/operate/_index.md index f1e40c8bba..6647c281a5 100644 --- a/content/operate/_index.md +++ b/content/operate/_index.md @@ -35,7 +35,7 @@ hideListLinks: true | | {{}} Redis Cloud | {{}} Redis Software | {{}} Redis Open Source | {{}} Redis for Kubernetes | |:-----------|:--------------|:-----------|:--------------|:--------------| | Monitoring | [Monitor performance]({{< relref "/operate/rc/databases/monitor-performance" >}}) | [Monitoring]({{}}) | [INFO]({{< relref "/commands/info" >}}), [MONITOR]({{< relref "/commands/monitor" >}}), and [LATENCY DOCTOR]({{< relref "/commands/latency-doctor" >}})
[Analysis with Redis Insight]({{< relref "/develop/tools/insight#database-analysis" >}}) | [Export metrics to Prometheus]({{}}) | -| Logging | [System logs]({{< relref "/operate/rc/logs-reports/system-logs" >}}) | [Logging]({{}}) | `/var/log/redis/redis.log`
[SLOWLOG]({{< relref "/commands/slowlog" >}})
[Keyspace notifications]({{< relref "/develop/use/keyspace-notifications" >}}) | [Logs]({{}}) | +| Logging | [System logs]({{< relref "/operate/rc/logs-reports/system-logs" >}}) | [Logging]({{}}) | `/var/log/redis/redis.log`
[SLOWLOG]({{< relref "/commands/slowlog" >}})
[Keyspace notifications]({{< relref "/develop/pubsub/keyspace-notifications" >}}) | [Logs]({{}}) | | Alerts | [Alerts]({{< relref "/operate/rc/databases/view-edit-database#alerts-section" >}}) | [Alerts and events]({{}}) | [Pub/sub with Redis Sentinel]({{< relref "/operate/oss_and_stack/management/sentinel#pubsub-messages" >}}) | [REDB alertSettings]({{}}) | | Support | [Contact support](https://redis.io/support/) | [Create support package]({{}}) | | [Contact support](https://redis.io/support/) | @@ -50,5 +50,5 @@ hideListLinks: true | Single sign-on (SSO) | [SAML SSO]({{< relref "/operate/rc/security/access-control/saml-sso" >}}) | | | | | Self-signed certificates | | [Certificates]({{}}) | [Certificate configuration]({{< relref "/operate/oss_and_stack/management/security/encryption#certificate-configuration" >}}) | [REC certificates]({{}}) | | Internode encryption | [Encryption at rest]({{< relref "/operate/rc/security/encryption-at-rest" >}}) | [Internode encryption]({{}}) | | [Enable internode encryption]({{}}) | -| Auditing | | [Audit events]({{}}) | [Keyspace notifications]({{< relref "/develop/use/keyspace-notifications" >}}) | | +| Auditing | | [Audit events]({{}}) | [Keyspace notifications]({{< relref "/develop/pubsub/keyspace-notifications" >}}) | | diff --git a/content/operate/kubernetes/architecture/_index.md b/content/operate/kubernetes/architecture/_index.md index d3e99f576a..6db8b88c56 100644 --- a/content/operate/kubernetes/architecture/_index.md +++ b/content/operate/kubernetes/architecture/_index.md @@ -9,7 +9,7 @@ description: Overview of the architecture and components of Redis Enterprise for hideListLinks: true linkTitle: Architecture weight: 1 -aliases: [operate/kubernetes/architecture/operator] +aliases: [/operate/kubernetes/architecture/operator/] --- Redis Enterprise for Kubernetes gives you the speed and durability of [Redis Enterprise](https://redis.io/redis-enterprise/advantages/), with the flexibility and ease of [Kubernetes (K8s)](https://kubernetes.io/). Redis Enterprise for Kubernetes uses the Kubernetes operator pattern and custom controllers to bring the best of Redis Enterprise to the Kubernetes platform. diff --git a/content/operate/kubernetes/deployment/container-images.md b/content/operate/kubernetes/deployment/container-images.md index 5b493f175a..5cd5c01adf 100644 --- a/content/operate/kubernetes/deployment/container-images.md +++ b/content/operate/kubernetes/deployment/container-images.md @@ -16,10 +16,12 @@ weight: 92 Redis Enterprise Software, its Kubernetes operator, and the Service Rigger are all distributed as separate container images. Your Kubernetes deployment will pull these images as needed. - You can control where these images are +You can control where these images are pulled from within the operator deployment and also via the Redis Enterprise custom resources. +The operator image also includes the admission controller, which runs as part of the operator container and provides validation for Redis Enterprise database resources. + In general, images for deployments that do not have a registry domain name (e.g., `gcr.io` or `localhost:5000`) are pulled from the default registry associated with the Kubernetes cluster. A plain reference to `redislabs/redis` will likely pull from DockerHub @@ -84,7 +86,7 @@ Important images for a Redis Enterprise Software deployment include: * Redis Enterprise Software * Bootstrapping a Redis Enterprise cluster node (in the operator image) * The Service Rigger -* The Redis Enterprise Software operator +* The Redis Enterprise Software operator (which also includes the admission controller) You will need to push all these images to your private container registry. In general, to push the images you must: @@ -123,7 +125,7 @@ require authentication. If you do need authentication, add a [pull secret](https ### Specify the operator image source -The operator bundle contains the operator deployment and the reference to the operator image (`redislabs/operator`). To use a private container registry, you must +The operator bundle contains the operator deployment and the reference to the operator image (`redislabs/operator`). This image includes both the operator functionality and the admission controller. To use a private container registry, you must change this image reference in your operator deployment file **before** you deploy the operator. If you apply this change to modify an existing operator deployment, the operator's pod will restart. In the operator deployment file, 'containers:image' should point to the same repository and tag you used when [pushing]({{< relref "/operate/kubernetes/deployment/container-images#push-images-to-a-private-container-registry" >}}) to the private container registry: @@ -238,6 +240,14 @@ spec: versionTag: 7.22.0-7 ``` +## Admission controller + +The admission controller is included as part of the operator container image and does not require a separate container image. When you configure a private container registry for the operator image, the admission controller functionality is automatically included. + +The admission controller runs within the operator pod and provides validation for Redis Enterprise database resources. It exposes an HTTPS endpoint on port 8443 that Kubernetes uses to validate resource configurations before they are applied to the cluster. + +For more information about configuring the admission controller, see [Enable the admission controller]({{< relref "/operate/kubernetes/deployment/quick-start#enable-the-admission-controller" >}}). + ## Rate limiting with DockerHub Docker has [rate limits for image pulls](https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/). diff --git a/content/operate/kubernetes/recommendations/node-selection.md b/content/operate/kubernetes/recommendations/node-selection.md index af288e511b..d06eb693df 100644 --- a/content/operate/kubernetes/recommendations/node-selection.md +++ b/content/operate/kubernetes/recommendations/node-selection.md @@ -187,19 +187,20 @@ during partitions or other rack (or region) related failures. Rack-zone awareness is a single property in the Redis Enterprise cluster CRD named `rackAwarenessNodeLabel`. -### Choosing a node label +### Choose a node label -The most commonly used label for rack-zone awareness is `topology.kubernetes.io/zone`, which is a well-known Kubernetes label that specifies the zone where a node runs. This label is readily available on all nodes in many Kubernetes platforms, as documented in ['Running in multiple zones'](https://kubernetes.io/docs/setup/best-practices/multiple-zones/#nodes-are-labeled). +The most common label used for rack-zone awareness is topology.kubernetes.io/zone, a standard Kubernetes label that shows the zone a node runs in. Many Kubernetes platforms add this label to nodes by default, as noted in the [Kubernetes documentation](https://kubernetes.io/docs/setup/best-practices/multiple-zones/#nodes-are-labeled). -However, not all Kubernetes platforms configure this label by default. You can use any custom label that indicates the topology information (rack, zone, region, etc.) for your nodes. +If your platform doesn’t set this label automatically, you can use any custom label that describes the node’s topology (such as rack, zone, or region). ### Node labeling requirements {{< warning >}} -**All eligible nodes must be labeled** with the chosen label for rack-awareness to work properly. The operator expects that all nodes where Redis Enterprise pods can be scheduled will have the specified label, and will fail and stop reconciliation if any eligible nodes are missing the label. + +**All eligible nodes must have the label for rack-awareness to work. The operator requires every node that might run Redis Enterprise pods to be labeled. If any are missing the label, reconciliation will fail. {{< /warning >}} -Eligible nodes are all nodes where Redis Enterprise pods can be scheduled. By default, these are all worker nodes in the cluster, but this can be restricted by specifying `.spec.nodeSelector` in the Redis Enterprise cluster (REC) configuration. +Eligible nodes are all nodes where Redis Enterprise pods can be scheduled. By default, these are all worker nodes in the cluster, but you can limit them using `spec.nodeSelector` in the Redis Enterprise cluster (REC) configuration. The value for the chosen label must indicate the topology information (rack, zone, region, etc.) for each node. diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Debugging.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Debugging.md index 0387902c00..3a2cc5dca1 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Debugging.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Debugging.md @@ -21,7 +21,7 @@ aliases: There are two methods you can use to debug your Redis Stack functions: 1. Make judicious use of the `redis.log` function, which writes to the Redis log file. -1. Use Redis [pub/sub]({{< relref "/develop/interact/pubsub" >}}). +1. Use Redis [pub/sub]({{< relref "/develop/pubsub" >}}). ### Use `redis.log` diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_CLI.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_CLI.md index 1c49062d23..e8a44968e1 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_CLI.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_CLI.md @@ -98,7 +98,7 @@ redis-cli -x TFUNCTION LOAD REPLACE < ./main.js Functions within Redis can respond to events using keyspace triggers. While the majority of these events are initiated by command invocations, they also include events that occur when a key expires or is removed from the database. -For the full list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/use/keyspace-notifications#events-generated-by-different-commands/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_triggers_and_functions_guide" >}}). +For the full list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/pubsub/keyspace-notifications#events-generated-by-different-commands/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_triggers_and_functions_guide" >}}). The following code creates a new keyspace trigger that adds a new field to a new or updated hash with the latest update time. diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md index 35b9b97659..c352222033 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md @@ -59,7 +59,7 @@ Click on the **+ Add Library** button as before and, instead of adding the code Functions within Redis can respond to events using keyspace triggers. While the majority of these events are initiated by command invocations, they also include events that occur when a key expires or is removed from the database. -For the full list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/use/keyspace-notifications#events-generated-by-different-commands/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_triggers_and_functions_guide" >}}). +For the full list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/pubsub/keyspace-notifications#events-generated-by-different-commands/?utm_source=redis\&utm_medium=app\&utm_campaign=redisinsight_triggers_and_functions_guide" >}}). The following code creates a new keyspace trigger that adds a new field to a new or updated hash with the latest update time. diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/KeySpace_Triggers.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/KeySpace_Triggers.md index 51fa1f8626..ac570f137f 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/KeySpace_Triggers.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/KeySpace_Triggers.md @@ -22,7 +22,7 @@ Keyspace triggers allow you to register a function that will be executed wheneve 1. Expired: This event is fired when a key expires from the database. 2. Evicted: This event is fired when a key is evicted from the database. -For a complete list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/use/keyspace-notifications#events-generated-by-different-commands" >}}). +For a complete list of supported events, please refer to the [Redis keyspace notifications page]({{< relref "develop/pubsub/keyspace-notifications#events-generated-by-different-commands" >}}). To register a keyspace trigger, you need to use the `redis.registerKeySpaceTrigger` API when loading your library. The following example demonstrates how to register a database trigger that adds a "last updated" field whenever a hash key is modified: diff --git a/content/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events.md b/content/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events.md index dd81dba2d4..73fd66a5f5 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events.md @@ -38,10 +38,10 @@ For more information and examples of event registration, see: ## Event types -For the list of event types you can register on, see the [Redis keyspace notification documentation]({{< relref "/develop/use/keyspace-notifications" >}}#events-generated-by-different-commands). +For the list of event types you can register on, see the [Redis keyspace notification documentation]({{< relref "/develop/pubsub/keyspace-notifications" >}}#events-generated-by-different-commands). ## Active-Active event types -In addition to standard Redis [events]({{< relref "/develop/use/keyspace-notifications" >}}#events-generated-by-different-commands), [Redis Enterprise Active-Active databases]({{< relref "/operate/rs/databases/active-active" >}}) also support the registration of RedisGears functions for the following event types: +In addition to standard Redis [events]({{< relref "/develop/pubsub/keyspace-notifications" >}}#events-generated-by-different-commands), [Redis Enterprise Active-Active databases]({{< relref "/operate/rs/databases/active-active" >}}) also support the registration of RedisGears functions for the following event types: - `change`: This event occurs when a key changes on another replica of the Active-Active database. diff --git a/content/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices.md b/content/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices.md index 93eaf535f3..c50aeb9a1e 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/search/scalable-query-best-practices.md @@ -10,7 +10,7 @@ linkTitle: Best practices for scalable Redis Query Engine weight: 25 --- -[Vertical scaling of Redis Query Engine]({{}}) requires configuring query performance factors. With careful crafting of search indices and queries, query performance factors allow throughput scaling up to 16X. The following recommendations help queries avoid accessing the keyspace and enable Redis Query Engine to benefit from additional CPUs allocated by query performance factors. +[Vertical scaling of Redis Query Engine]({{}}) requires configuring query performance factors. With careful crafting of search indexes and queries, query performance factors allow throughput scaling up to 16X. The following recommendations can help optimize your indexes and queries to maximize the performance benefits from additional CPUs allocated by query performance factors. ## Best candidates for query performance factor improvements @@ -22,13 +22,29 @@ weight: 25 - [Vector]({{}}) -- Result set types: + - [Numeric]({{}}) + + - [Geo]({{}}) + +- Result set types: - Small result sets - Document subsets that are indexed in their [non-normalized]({{}}) form -## Indexing best practices +## Best practices + +If query performance factors have not boosted the performance of your queries as much as expected: + +1. Verify your index includes all queried and returned fields. + +1. Identify and avoid query [anti-patterns]({{}}) that limit scalability. + +1. Follow best practices to [improve indexing](#improve-indexing). + +1. Follow best practices to [improve queries](#improve-queries). + +### Improve indexing Follow these best practices for [indexing]({{}}): @@ -40,9 +56,9 @@ Follow these best practices for [indexing]({{}}): +Follow these best practices to optimize [queries]({{}}): - Specify the result set fields in the `RETURN` or `LOAD` clauses and include them in the index definition. Don’t just return the default result set from [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) or `LOAD *` from [`FT.AGGREGATE`]({{< relref "commands/ft.aggregate/" >}}). @@ -97,3 +113,94 @@ FT.AGGREGATE jsonidx:profiles '@t:[1299 1299]' LIMIT 0 10 DIALECT 3 ``` + +## Performance results + +The following benchmarks show the performance improvements for different query types achieved with query performance factors. Vector, tag, and text queries strongly benefit, while numeric and geographic queries show more limited improvements. + +### Vector schema type + +#### Vector ingest + +| Shards | Threads per shard | CPUs | Speedup factor | +|--------|-------------------|------|----------------| +| 1 | 0 | 1 | 0 | +| 6 | 0 | 6 | 6.6 | +| 1 | 6 | 6 | 2.5 | +| 2 | 6 | 12 | 6.1 | +| 4 | 6 | 24 | 24.3 | + +#### Vector query + +| Shards | Threads per shard | CPUs | Speedup factor | +|--------|-------------------|------|----------------| +| 1 | 0 | 1 | 0 | +| 6 | 0 | 6 | 0.8 | +| 1 | 6 | 6 | 4.7 | +| 2 | 6 | 12 | 5.1 | +| 4 | 6 | 24 | 5.6 | + +### Tag schema type + +| Worker threads | % change | +|----------------|----------| +| 0 | 0 | +| 6 | 135.88 | + +### Text schema type + +#### Two-word union queries + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 188 | 0 | +| 6 | 1,072 | 470 | +| 12 | 1,995 | 961 | +| 18 | 2,834 | 1,407 | + +#### Two-word intersection queries + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 2,373 | 0 | +| 6 | 12,396 | 422 | +| 12 | 17,506 | 638 | +| 18 | 19,764 | 733 | + +#### Simple one-word match + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 476 | 0 | +| 6 | 2,837 | 496 | +| 12 | 5,292 | 1,012 | +| 18 | 7,512 | 1,478 | + +### Numeric schema type + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 33,584 | 0 | +| 1 | 36,993 | 10.15 | +| 3 | 36,504 | 8.69 | +| 6 | 36,897 | 9.86 | + +### Geo schema type + +#### Geo queries without UNF + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 48 | 0 | +| 6 | 96 | 100 | +| 12 | 96 | 100 | +| 18 | 98 | 104 | + +#### Geo queries with UNF + +| Worker threads | Queries per second | % change | +|----------------|--------------------|----------| +| 0 | 61 | 0 | +| 6 | 227 | 272 | +| 12 | 217 | 256 | +| 18 | 217 | 256 | diff --git a/content/operate/rc/api/api-reference/openapi.json b/content/operate/rc/api/api-reference/openapi.json index 149d7d4a8c..293e3a8cb8 100644 --- a/content/operate/rc/api/api-reference/openapi.json +++ b/content/operate/rc/api/api-reference/openapi.json @@ -41,11 +41,6 @@ "description": "All Pro subscription connectivity operations.", "x-order": "11" }, - { - "name": "Subscriptions - Dedicated", - "description": "All Dedicated subscription operations.", - "x-order": "11" - }, { "name": "Databases - Pro", "description": "All Pro database operations.", @@ -3082,7 +3077,7 @@ ], "summary": "Get a single Essentials subscription", "description": "Gets information on the specified Essentials subscription.", - "operationId": "getSubscriptionById_2", + "operationId": "getSubscriptionById_1", "parameters": [ { "name": "subscriptionId", @@ -8582,64 +8577,6 @@ } } }, - "/subscriptions/dedicated/{subscriptionId}": { - "get": { - "tags": [ - "Subscriptions - Dedicated" - ], - "summary": "Get a single dedicated subscription", - "description": "Gets information on the specified dedicated subscription.", - "operationId": "getSubscriptionById_1", - "parameters": [ - { - "name": "subscriptionId", - "in": "path", - "description": "Subscription ID.", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "400": { - "description": "Bad Request - The server cannot process the request due to something that is perceived to be a client error" - }, - "412": { - "description": "Precondition Failed - Feature flag for this flow is off" - }, - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DedicatedSubscription" - } - } - } - }, - "401": { - "description": "Unauthorized - Authentication failed for requested resource" - }, - "403": { - "description": "Forbidden - Not allowed to access requested resource (primarily due to client source IP API Key restrictions)" - }, - "404": { - "description": "Not Found - The resource you were trying to reach was not found or does not exist" - }, - "429": { - "description": "Too Many Requests - Too many resources are concurrently created / updated / deleted in the account. Please re-submit API requests after resource changes are completed)" - }, - "500": { - "description": "Internal system error - If this error persists, please contact customer support" - }, - "503": { - "description": "Service Unavailable - Server is temporarily unable to handle the request, please try again later. If this error persists, please contact customer support " - } - } - } - }, "/session-logs": { "get": { "tags": [ @@ -13633,60 +13570,6 @@ }, "description": "Database tag" }, - "DedicatedSubscription": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Unique identifier for the subscription", - "format": "int32" - }, - "name": { - "type": "string", - "description": "Name of the subscription" - }, - "paymentMethodId": { - "type": "integer", - "description": "Payment method identifier", - "format": "int32" - }, - "status": { - "type": "string", - "description": "Current status of the subscription" - }, - "memoryStorage": { - "type": "string", - "description": "Memory storage configuration for the subscription", - "enum": [ - "ram", - "ram-and-flash" - ] - }, - "numberOfDatabases": { - "type": "integer", - "description": "Number of databases in the subscription", - "format": "int32" - }, - "paymentMethodType": { - "type": "string", - "description": "Type of payment method used", - "enum": [ - "credit-card", - "marketplace" - ] - }, - "links": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - } - }, - "description": "Redis Dedicated Subscription information" - }, "SubscriptionSpec": { "required": [ "regions" diff --git a/content/operate/rc/databases/configuration/sizing.md b/content/operate/rc/databases/configuration/sizing.md index f62ba578c4..4c2e8f31b8 100644 --- a/content/operate/rc/databases/configuration/sizing.md +++ b/content/operate/rc/databases/configuration/sizing.md @@ -55,7 +55,7 @@ Here are some things to keep in mind for optimizing throughput: - Test and monitor your app's performance and adjust the set ops/sec based on how if performs in real-world conditions. - If your average request size is larger than 3KB, consider setting your throughput higher than expected. - Track the slow logs using the [`SLOWLOG` command]({{< relref "/commands/slowlog" >}}) or the **Slowlog** tab on the [database screen]({{< relref "/operate/rc/databases/view-edit-database" >}}). -- Use [pipelining]({{< relref "/develop/use/pipelining" >}}) and [concurrent connections]({{< relref "/develop/reference/clients" >}}) effectively to optimize throughput and latency. +- Use [pipelining]({{< relref "/develop/using-commands/pipelining" >}}) and [concurrent connections]({{< relref "/develop/reference/clients" >}}) effectively to optimize throughput and latency. - Search databases have their own throughput requirements. See [Search and query sizing]({{< relref "/operate/rc/databases/configuration/advanced-capabilities#search-and-query-sizing" >}}) for more info. ### Frequently asked questions diff --git a/content/operate/rc/security/access-control/data-access-control/configure-acls.md b/content/operate/rc/security/access-control/data-access-control/configure-acls.md index bbde88e518..aa1c56b51f 100644 --- a/content/operate/rc/security/access-control/data-access-control/configure-acls.md +++ b/content/operate/rc/security/access-control/data-access-control/configure-acls.md @@ -56,7 +56,7 @@ You can define these permissions using the [Redis ACL syntax]({{< relref "/opera - `-` *excludes* commands or command categories - `@` indicates a command category - `~` defines a permitted key pattern -- `&` allows access to a [pub/sub channel]({{< relref "/develop/interact/pubsub" >}}) +- `&` allows access to a [pub/sub channel]({{< relref "/develop/pubsub" >}}) The Redis Cloud console will validate your ACL syntax while you are typing. @@ -116,7 +116,7 @@ For more information on how this works, see the [key permissions syntax]({{< rel ### Pub/sub ACL rules -Pub/sub ACL rules determine which pub/sub channels a user can access. For more information see, [Redis pub/sub]({{< relref "/develop/interact/pubsub" >}}) +Pub/sub ACL rules determine which pub/sub channels a user can access. For more information see, [Redis pub/sub]({{< relref "/develop/pubsub" >}}) For versions older than Redis 7.0, pub/sub is permissive and allows access to all channels by default. diff --git a/content/operate/rs/7.4/databases/import-export/replica-of/create.md b/content/operate/rs/7.4/databases/import-export/replica-of/create.md index e552546f67..2c334ce61c 100644 --- a/content/operate/rs/7.4/databases/import-export/replica-of/create.md +++ b/content/operate/rs/7.4/databases/import-export/replica-of/create.md @@ -72,6 +72,12 @@ To configure a Replica Of database in the same Redis Enterprise cluster as the s To configure a Replica Of database in a different Redis Enterprise cluster from the source database: +1. Ensure the source database's port is allowed through firewalls between the clusters and can be accessed by the destination cluster's nodes. + + {{}} +Ports 10000-19999 are reserved for database traffic. See [Network port configurations]({{}}) for more information about ports. + {{}} + 1. Sign in to the Cluster Manager UI of the cluster hosting the source database. 1. In **Databases**, select the source database and then select the **Configuration** tab. diff --git a/content/operate/rs/7.4/databases/recover.md b/content/operate/rs/7.4/databases/recover.md index 241f9e6cf4..e7048f5508 100644 --- a/content/operate/rs/7.4/databases/recover.md +++ b/content/operate/rs/7.4/databases/recover.md @@ -24,6 +24,7 @@ The database recovery process includes: 1. If the cluster failed, [recover the cluster]({{< relref "/operate/rs/7.4/clusters/cluster-recovery.md" >}}). 1. Identify recoverable databases. +1. Verify the module versions used by any databases are installed on the cluster. 1. Restore the database data. 1. Verify that the databases are active. @@ -55,7 +56,7 @@ of the configuration and persistence files on each of the nodes. If you use local persistent storage, place all of the recovery files on each of the cluster nodes. -1. To see which databases are recoverable, run: +1. To see which databases are recoverable, run [`rladmin recover list`]({{}}): ```sh rladmin recover list @@ -71,6 +72,76 @@ of the configuration and persistence files on each of the nodes. If you cannot resolve the issues, contact [Redis support](https://redis.com/company/support/). +1. Verify the module versions used by any recoverable databases are installed on the cluster: + + 1. Check which module versions are currently installed on the cluster using one of the following methods: + + {{< multitabs id="get-module-versions" + tab1="Cluster Manager UI" + tab2="rladmin" + tab3="REST API" >}} + +In the Cluster Manager UI, go to **Cluster > Modules**. + +-tab-sep- + +Run [`rladmin status modules`]({{< relref "/operate/rs/7.4/references/cli-utilities/rladmin/status#status-modules" >}}): + +```sh +rladmin status modules +``` + +-tab-sep- + +Send a [`GET /v1/modules`]({{< relref "/operate/rs/7.4/references/rest-api/requests/modules#list-modules" >}}) request: + +```sh +GET https://:/v1/modules +``` + + {{< /multitabs >}} + + 1. Identify the module versions required by the recoverable databases. To do so, run [`rladmin status modules`]({{< relref "/operate/rs/7.4/references/cli-utilities/rladmin/status#status-modules" >}}) and check the `DATABASE MODULES` section for the module versions listed for the recoverable databases: + + ```sh + rladmin status modules extra all + ``` + + 1. Download any missing modules versions from the [Redis download center](https://redis.io/downloads/#tools). + + 1. [Install the downloaded modules on the cluster]({{< relref "/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster" >}}) using one of the following methods: + + {{< multitabs id="install-modules" + tab1="Cluster Manager UI" + tab2="REST API" >}} + +To add a module to the cluster using the Cluster Manager UI: + +1. Go to **Cluster > Modules**. + +1. Select **Upload module**. + +1. Use the file browser to add the packaged module. + +-tab-sep- + +To add a module to the cluster using the REST API: + +1. Copy the module package to a node in the cluster. + +1. Add the module to the cluster with a [`POST` request to the `/v2/modules`]({{< relref "/operate/rs/7.4/references/rest-api/requests/modules#post-module-v2" >}}) endpoint: + + ```sh + POST https://[host][:port]/v2/modules + "module=@/tmp/redisearch.Linux-ubuntu16.04-x86_64.2.2.6.zip" + ``` + + Here, the *module* parameter specifies the full path of the module package and must be submitted as form-data. In addition, the package must be available and accessible to the server processing the request. + +1. If the module installation succeeds, the `POST` request returns a [JSON object]({{< relref "/operate/rs/7.4/references/rest-api/objects/module" >}}) that represents the new module. If it fails, it may return a JSON object with an `error_code` and `description` with more details. + + {{< /multitabs >}} + 1. Recover the database using one of the following [`rladmin recover`]({{< relref "/operate/rs/7.4/references/cli-utilities/rladmin/recover" >}}) commands: - Recover all databases from the persistence files located in the persistent storage drives: diff --git a/content/operate/rs/7.4/references/compatibility/commands/server.md b/content/operate/rs/7.4/references/compatibility/commands/server.md index 8055707664..9a5749b48e 100644 --- a/content/operate/rs/7.4/references/compatibility/commands/server.md +++ b/content/operate/rs/7.4/references/compatibility/commands/server.md @@ -21,19 +21,19 @@ Several access control list (ACL) commands are not available in Redis Enterprise | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| -| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL DELUSER]({{< relref "/commands/acl-deluser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL DRYRUN]({{< relref "/commands/acl-dryrun" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Might reply with "unknown user" for LDAP users even if `AUTH` succeeds. | | [ACL GENPASS]({{< relref "/commands/acl-genpass" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL LOAD]({{< relref "/commands/acl-load" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL LOG]({{< relref "/commands/acl-log" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SAVE]({{< relref "/commands/acl-save" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SETUSER]({{< relref "/commands/acl-setuser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Configuration commands @@ -89,7 +89,7 @@ Although Redis Enterprise does not support certain monitoring commands, you can | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| | [DBSIZE]({{< relref "/commands/dbsize" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | +| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | | [LATENCY DOCTOR]({{< relref "/commands/latency-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY GRAPH]({{< relref "/commands/latency-graph" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY HELP]({{< relref "/commands/latency-help" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | @@ -98,15 +98,15 @@ Although Redis Enterprise does not support certain monitoring commands, you can | [LATENCY LATEST]({{< relref "/commands/latency-latest" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY RESET]({{< relref "/commands/latency-reset" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY DOCTOR]({{< relref "/commands/memory-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MEMORY MALLOC-STATS]({{< relref "/commands/memory-malloc-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY PURGE]({{< relref "/commands/memory-purge" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY STATS]({{< relref "/commands/memory-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MONITOR]({{< relref "/commands/monitor" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Persistence commands diff --git a/content/operate/rs/7.4/security/access-control/redis-acl-overview.md b/content/operate/rs/7.4/security/access-control/redis-acl-overview.md index 29c7179e13..980e0b3665 100644 --- a/content/operate/rs/7.4/security/access-control/redis-acl-overview.md +++ b/content/operate/rs/7.4/security/access-control/redis-acl-overview.md @@ -75,7 +75,7 @@ The following example allows read and write access to all keys that start with " ### Pub/sub channels -The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). +The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). To limit access to specific channels, include `resetchannels` before the allowed channels: @@ -99,7 +99,7 @@ In the following example, the base rule allows `GET key1` and the selector allow ## Default pub/sub permissions -Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) a user can access. +Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/pubsub" >}}) a user can access. The configuration option `acl-pubsub-default`, added in Redis Enterprise Software version 6.4.2, determines the cluster-wide default level of access for all pub/sub channels. Redis Enterprise Software uses the following pub/sub permissions by default: diff --git a/content/operate/rs/7.8/databases/import-export/replica-of/create.md b/content/operate/rs/7.8/databases/import-export/replica-of/create.md index 8023911f2f..d4c43d512a 100644 --- a/content/operate/rs/7.8/databases/import-export/replica-of/create.md +++ b/content/operate/rs/7.8/databases/import-export/replica-of/create.md @@ -72,6 +72,12 @@ To configure a Replica Of database in the same Redis Enterprise cluster as the s To configure a Replica Of database in a different Redis Enterprise cluster from the source database: +1. Ensure the source database's port is allowed through firewalls between the clusters and can be accessed by the destination cluster's nodes. + + {{}} +Ports 10000-19999 are reserved for database traffic. See [Network port configurations]({{}}) for more information about ports. + {{}} + 1. Sign in to the Cluster Manager UI of the cluster hosting the source database. 1. In **Databases**, select the source database and then select the **Configuration** tab. diff --git a/content/operate/rs/7.8/databases/recover.md b/content/operate/rs/7.8/databases/recover.md index ba4a01524d..446ef63db0 100644 --- a/content/operate/rs/7.8/databases/recover.md +++ b/content/operate/rs/7.8/databases/recover.md @@ -24,6 +24,7 @@ The database recovery process includes: 1. If the cluster failed, [recover the cluster]({{< relref "/operate/rs/7.8/clusters/cluster-recovery.md" >}}). 1. Identify recoverable databases. +1. Verify the module versions used by any databases are installed on the cluster. 1. Restore the database data. 1. Verify that the databases are active. @@ -55,7 +56,7 @@ of the configuration and persistence files on each of the nodes. If you use local persistent storage, place all of the recovery files on each of the cluster nodes. -1. To see which databases are recoverable, run: +1. To see which databases are recoverable, run [`rladmin recover list`]({{}}): ```sh rladmin recover list @@ -71,6 +72,76 @@ of the configuration and persistence files on each of the nodes. If you cannot resolve the issues, contact [Redis support](https://redis.com/company/support/). +1. Verify the module versions used by any recoverable databases are installed on the cluster: + + 1. Check which module versions are currently installed on the cluster using one of the following methods: + + {{< multitabs id="get-module-versions" + tab1="Cluster Manager UI" + tab2="rladmin" + tab3="REST API" >}} + +In the Cluster Manager UI, go to **Cluster > Modules**. + +-tab-sep- + +Run [`rladmin status modules`]({{< relref "/operate/rs/7.8/references/cli-utilities/rladmin/status#status-modules" >}}): + +```sh +rladmin status modules +``` + +-tab-sep- + +Send a [`GET /v1/modules`]({{< relref "/operate/rs/7.8/references/rest-api/requests/modules#list-modules" >}}) request: + +```sh +GET https://:/v1/modules +``` + + {{< /multitabs >}} + + 1. Identify the module versions required by the recoverable databases. To do so, run [`rladmin status modules`]({{< relref "/operate/rs/7.8/references/cli-utilities/rladmin/status#status-modules" >}}) and check the `DATABASE MODULES` section for the module versions listed for the recoverable databases: + + ```sh + rladmin status modules extra all + ``` + + 1. Download any missing modules versions from the [Redis download center](https://redis.io/downloads/#tools). + + 1. [Install the downloaded modules on the cluster]({{< relref "/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster" >}}) using one of the following methods: + + {{< multitabs id="install-modules" + tab1="Cluster Manager UI" + tab2="REST API" >}} + +To add a module to the cluster using the Cluster Manager UI: + +1. Go to **Cluster > Modules**. + +1. Select **Upload module**. + +1. Use the file browser to add the packaged module. + +-tab-sep- + +To add a module to the cluster using the REST API: + +1. Copy the module package to a node in the cluster. + +1. Add the module to the cluster with a [`POST` request to the `/v2/modules`]({{< relref "/operate/rs/7.8/references/rest-api/requests/modules#post-module-v2" >}}) endpoint: + + ```sh + POST https://[host][:port]/v2/modules + "module=@/tmp/redisearch.Linux-ubuntu16.04-x86_64.2.2.6.zip" + ``` + + Here, the *module* parameter specifies the full path of the module package and must be submitted as form-data. In addition, the package must be available and accessible to the server processing the request. + +1. If the module installation succeeds, the `POST` request returns a [JSON object]({{< relref "/operate/rs/7.8/references/rest-api/objects/module" >}}) that represents the new module. If it fails, it may return a JSON object with an `error_code` and `description` with more details. + + {{< /multitabs >}} + 1. Recover the database using one of the following [`rladmin recover`]({{< relref "/operate/rs/7.8/references/cli-utilities/rladmin/recover" >}}) commands: - Recover all databases from the persistence files located in the persistent storage drives: diff --git a/content/operate/rs/7.8/references/compatibility/commands/server.md b/content/operate/rs/7.8/references/compatibility/commands/server.md index cf22e1588e..fbc74a849d 100644 --- a/content/operate/rs/7.8/references/compatibility/commands/server.md +++ b/content/operate/rs/7.8/references/compatibility/commands/server.md @@ -21,19 +21,19 @@ Several access control list (ACL) commands are not available in Redis Enterprise | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| -| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL DELUSER]({{< relref "/commands/acl-deluser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL DRYRUN]({{< relref "/commands/acl-dryrun" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Might reply with "unknown user" for LDAP users even if `AUTH` succeeds. | | [ACL GENPASS]({{< relref "/commands/acl-genpass" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL LOAD]({{< relref "/commands/acl-load" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL LOG]({{< relref "/commands/acl-log" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SAVE]({{< relref "/commands/acl-save" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SETUSER]({{< relref "/commands/acl-setuser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Configuration commands @@ -89,7 +89,7 @@ Although Redis Enterprise does not support certain monitoring commands, you can | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| | [DBSIZE]({{< relref "/commands/dbsize" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | +| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | | [LATENCY DOCTOR]({{< relref "/commands/latency-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY GRAPH]({{< relref "/commands/latency-graph" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY HELP]({{< relref "/commands/latency-help" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | @@ -98,15 +98,15 @@ Although Redis Enterprise does not support certain monitoring commands, you can | [LATENCY LATEST]({{< relref "/commands/latency-latest" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY RESET]({{< relref "/commands/latency-reset" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY DOCTOR]({{< relref "/commands/memory-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MEMORY MALLOC-STATS]({{< relref "/commands/memory-malloc-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY PURGE]({{< relref "/commands/memory-purge" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY STATS]({{< relref "/commands/memory-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MONITOR]({{< relref "/commands/monitor" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Persistence commands diff --git a/content/operate/rs/7.8/security/access-control/redis-acl-overview.md b/content/operate/rs/7.8/security/access-control/redis-acl-overview.md index 1e1523e878..3b5aa4993f 100644 --- a/content/operate/rs/7.8/security/access-control/redis-acl-overview.md +++ b/content/operate/rs/7.8/security/access-control/redis-acl-overview.md @@ -73,7 +73,7 @@ The following example allows read and write access to all keys that start with " ### Pub/sub channels -The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). +The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). To limit access to specific channels, include `resetchannels` before the allowed channels: @@ -97,7 +97,7 @@ In the following example, the base rule allows `GET key1` and the selector allow ## Default pub/sub permissions -Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) a user can access. +Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/pubsub" >}}) a user can access. The configuration option `acl-pubsub-default`, added in Redis Enterprise Software version 6.4.2, determines the cluster-wide default level of access for all pub/sub channels. Redis Enterprise Software uses the following pub/sub permissions by default: diff --git a/content/operate/rs/databases/import-export/replica-of/create.md b/content/operate/rs/databases/import-export/replica-of/create.md index b2241e1171..474b263a0a 100644 --- a/content/operate/rs/databases/import-export/replica-of/create.md +++ b/content/operate/rs/databases/import-export/replica-of/create.md @@ -71,6 +71,12 @@ To configure a Replica Of database in the same Redis Enterprise cluster as the s To configure a Replica Of database in a different Redis Enterprise cluster from the source database: +1. Ensure the source database's port is allowed through firewalls between the clusters and can be accessed by the destination cluster's nodes. + + {{}} +Ports 10000-19999 are reserved for database traffic. See [Network port configurations]({{}}) for more information about ports. + {{}} + 1. Sign in to the Cluster Manager UI of the cluster hosting the source database. 1. In **Databases**, select the source database and then select the **Configuration** tab. diff --git a/content/operate/rs/databases/recover.md b/content/operate/rs/databases/recover.md index 6662210145..a256d1e051 100644 --- a/content/operate/rs/databases/recover.md +++ b/content/operate/rs/databases/recover.md @@ -23,6 +23,7 @@ The database recovery process includes: 1. If the cluster failed, [recover the cluster]({{< relref "/operate/rs/clusters/cluster-recovery.md" >}}). 1. Identify recoverable databases. +1. Verify the module versions used by any databases are installed on the cluster. 1. Restore the database data. 1. Verify that the databases are active. @@ -54,7 +55,7 @@ of the configuration and persistence files on each of the nodes. If you use local persistent storage, place all of the recovery files on each of the cluster nodes. -1. To see which databases are recoverable, run: +1. To see which databases are recoverable, run [`rladmin recover list`]({{}}): ```sh rladmin recover list @@ -70,6 +71,76 @@ of the configuration and persistence files on each of the nodes. If you cannot resolve the issues, contact [Redis support](https://redis.com/company/support/). +1. Verify the module versions used by any recoverable databases are installed on the cluster: + + 1. Check which module versions are currently installed on the cluster using one of the following methods: + + {{< multitabs id="get-module-versions" + tab1="Cluster Manager UI" + tab2="rladmin" + tab3="REST API" >}} + +In the Cluster Manager UI, go to **Cluster > Modules**. + +-tab-sep- + +Run [`rladmin status modules`]({{< relref "/operate/rs/references/cli-utilities/rladmin/status#status-modules" >}}): + +```sh +rladmin status modules +``` + +-tab-sep- + +Send a [`GET /v1/modules`]({{< relref "/operate/rs/references/rest-api/requests/modules#list-modules" >}}) request: + +```sh +GET https://:/v1/modules +``` + + {{< /multitabs >}} + + 1. Identify the module versions required by the recoverable databases. To do so, run [`rladmin status modules`]({{< relref "/operate/rs/references/cli-utilities/rladmin/status#status-modules" >}}) and check the `DATABASE MODULES` section for the module versions listed for the recoverable databases: + + ```sh + rladmin status modules extra all + ``` + + 1. Download any missing modules versions from the [Redis download center](https://redis.io/downloads/#tools). + + 1. [Install the downloaded modules on the cluster]({{< relref "/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster" >}}) using one of the following methods: + + {{< multitabs id="install-modules" + tab1="Cluster Manager UI" + tab2="REST API" >}} + +To add a module to the cluster using the Cluster Manager UI: + +1. Go to **Cluster > Modules**. + +1. Select **Upload module**. + +1. Use the file browser to add the packaged module. + +-tab-sep- + +To add a module to the cluster using the REST API: + +1. Copy the module package to a node in the cluster. + +1. Add the module to the cluster with a [`POST` request to the `/v2/modules`]({{< relref "/operate/rs/references/rest-api/requests/modules#post-module-v2" >}}) endpoint: + + ```sh + POST https://[host][:port]/v2/modules + "module=@/tmp/redisearch.Linux-ubuntu16.04-x86_64.2.2.6.zip" + ``` + + Here, the *module* parameter specifies the full path of the module package and must be submitted as form-data. In addition, the package must be available and accessible to the server processing the request. + +1. If the module installation succeeds, the `POST` request returns a [JSON object]({{< relref "/operate/rs/references/rest-api/objects/module" >}}) that represents the new module. If it fails, it may return a JSON object with an `error_code` and `description` with more details. + + {{< /multitabs >}} + 1. Recover the database using one of the following [`rladmin recover`]({{< relref "/operate/rs/references/cli-utilities/rladmin/recover" >}}) commands: - Recover all databases from the persistence files located in the persistent storage drives: diff --git a/content/operate/rs/references/compatibility/commands/server.md b/content/operate/rs/references/compatibility/commands/server.md index 1f3dac4bda..cd5800b4fb 100644 --- a/content/operate/rs/references/compatibility/commands/server.md +++ b/content/operate/rs/references/compatibility/commands/server.md @@ -20,19 +20,19 @@ Several access control list (ACL) commands are not available in Redis Enterprise | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| -| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL CAT]({{< relref "/commands/acl-cat" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL DELUSER]({{< relref "/commands/acl-deluser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL DRYRUN]({{< relref "/commands/acl-dryrun" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Might reply with "unknown user" for LDAP users even if `AUTH` succeeds. | | [ACL GENPASS]({{< relref "/commands/acl-genpass" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL GETUSER]({{< relref "/commands/acl-getuser" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL HELP]({{< relref "/commands/acl-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL LIST]({{< relref "/commands/acl-list" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | | [ACL LOAD]({{< relref "/commands/acl-load" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL LOG]({{< relref "/commands/acl-log" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SAVE]({{< relref "/commands/acl-save" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [ACL SETUSER]({{< relref "/commands/acl-setuser" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL USERS]({{< relref "/commands/acl-users" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [ACL WHOAMI]({{< relref "/commands/acl-whoami" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Configuration commands @@ -88,7 +88,7 @@ Although Redis Enterprise does not support certain monitoring commands, you can | Command | Redis
Enterprise | Redis
Cloud | Notes | |:--------|:----------------------|:-----------------|:------| | [DBSIZE]({{< relref "/commands/dbsize" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | +| [INFO]({{< relref "/commands/info" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | In Redis Enterprise, `INFO` returns a different set of fields than Redis Open Source.
Not supported for [scripts]({{}}). | | [LATENCY DOCTOR]({{< relref "/commands/latency-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY GRAPH]({{< relref "/commands/latency-graph" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY HELP]({{< relref "/commands/latency-help" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | @@ -97,15 +97,15 @@ Although Redis Enterprise does not support certain monitoring commands, you can | [LATENCY LATEST]({{< relref "/commands/latency-latest" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [LATENCY RESET]({{< relref "/commands/latency-reset" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY DOCTOR]({{< relref "/commands/memory-doctor" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY HELP]({{< relref "/commands/memory-help" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MEMORY MALLOC-STATS]({{< relref "/commands/memory-malloc-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY PURGE]({{< relref "/commands/memory-purge" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | | [MEMORY STATS]({{< relref "/commands/memory-stats" >}}) | ❌ Standard
❌ Active-Active | ❌ Standard
❌ Active-Active | | -| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | +| [MEMORY USAGE]({{< relref "/commands/memory-usage" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}) in Redis versions earlier than 7. | | [MONITOR]({{< relref "/commands/monitor" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | | -| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | -| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG GET]({{< relref "/commands/slowlog-get" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG LEN]({{< relref "/commands/slowlog-len" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | +| [SLOWLOG RESET]({{< relref "/commands/slowlog-reset" >}}) | ✅ Standard
✅ Active-Active | ✅ Standard
✅ Active-Active | Not supported for [scripts]({{}}). | ## Persistence commands diff --git a/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md b/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md index 07d8fb2c32..da04ff9ca7 100644 --- a/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md +++ b/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md @@ -53,7 +53,7 @@ This version offers: The following Redis 7.0 features are now supported: -- [Redis functions]({{< relref "/develop/interact/programmability/functions-intro" >}}) +- [Redis functions]({{< relref "/develop/programmability/functions-intro" >}}) In Redis Enterprise Software, [`FUNCTION STATS`]({{< relref "/commands/function-stats" >}}) returns an extra parameter, an array called `all_running_scripts`, to reflect multiple functions running at the same time. @@ -131,7 +131,7 @@ If you run Redis Stack commands with Redis clients [Go-Redis](https://redis.uptr #### Sharded pub/sub -[Sharded pub/sub]({{< relref "/develop/interact/pubsub" >}}#sharded-pubsub) is now supported. +[Sharded pub/sub]({{< relref "/develop/pubsub" >}}#sharded-pubsub) is now supported. You cannot use sharded pub/sub if you [deactivate RESP3 support]({{< relref "/operate/rs/references/compatibility/resp#deactivate-resp3" >}}). @@ -586,7 +586,7 @@ Certain operating systems, such as RHEL 8, have already removed support for the #### Prepare for restrictive pub/sub permissions -Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) a user can access. +Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/pubsub" >}}) a user can access. The configuration option `acl-pubsub-default`, added in Redis Enterprise Software version 6.4.2, determines the cluster-wide default level of access for all pub/sub channels. Redis Enterprise Software uses the following pub/sub permissions by default: diff --git a/content/operate/rs/security/access-control/redis-acl-overview.md b/content/operate/rs/security/access-control/redis-acl-overview.md index 8ce99d2d8d..57410069a9 100644 --- a/content/operate/rs/security/access-control/redis-acl-overview.md +++ b/content/operate/rs/security/access-control/redis-acl-overview.md @@ -72,7 +72,7 @@ The following example allows read and write access to all keys that start with " ### Pub/sub channels -The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). +The `&` prefix allows access to [pub/sub channels]({{< relref "/develop/pubsub" >}}) (only supported for databases with Redis version 6.2 or later). To limit access to specific channels, include `resetchannels` before the allowed channels: @@ -96,7 +96,7 @@ In the following example, the base rule allows `GET key1` and the selector allow ## Default pub/sub permissions -Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/interact/pubsub" >}}) a user can access. +Redis database version 6.2 introduced pub/sub ACL rules that determine which [pub/sub channels]({{< relref "/develop/pubsub" >}}) a user can access. The configuration option `acl-pubsub-default`, added in Redis Enterprise Software version 6.4.2, determines the cluster-wide default level of access for all pub/sub channels. Redis Enterprise Software uses the following pub/sub permissions by default: diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000000..0a12e62794 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,11 @@ +{{- $anchor := .Anchor | safeURL -}} +{{- $level := .Level -}} +{{- $text := .Text | safeHTML -}} + + {{ $text }} +
+ + + + + diff --git a/layouts/partials/docs-toc.html b/layouts/partials/docs-toc.html index 63f2a09304..1146dd839d 100644 --- a/layouts/partials/docs-toc.html +++ b/layouts/partials/docs-toc.html @@ -4,7 +4,7 @@ {{ $showEmbedHeaders := .Params.tocEmbedHeaders }} {{ $headerRange := .Params.headerRange | default "[1-3]" }} -{{ $headers := findRE ( print "(.|\n])+?") .Content }} +{{ $headers := findRE ( print "(.|\n)+?") .Content }} {{ $has_headers := ge (len $headers) 1 }} @@ -31,7 +31,9 @@

On this page

{{ end }} -
  • {{ $header | plainify | safeHTML }} + + {{ $headerText := $header | replaceRE `]*class="header-link"[^>]*>.*?` "" | plainify | safeHTML }} +
  • {{ $headerText }} {{ $prevLevel = $level }} {{ end }} diff --git a/static/images/dev/reference/pipeline_iops.webp b/static/images/dev/reference/pipeline_iops.webp new file mode 100644 index 0000000000000000000000000000000000000000..efb789ac3d2572dfcc6b7fa21ebddd0ed90c17ca GIT binary patch literal 3144 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 { toggleMenu('products-mobile-menu', 'productsMobileMenuState') } else if (event.target.closest('[data-resources-mobile-menu-toggle]')) { toggleMenu('resources-mobile-menu', 'resourcesMobileMenuState') + } else if (event.target.closest('.header-link')) { + // Handle header link clicks + event.preventDefault() + copyHeaderLinkToClipboard(event.target.closest('.header-link')) } } + // Copy header link URL to clipboard + function copyHeaderLinkToClipboard(linkElement) { + const href = linkElement.getAttribute('href') + const fullUrl = window.location.origin + window.location.pathname + href + + // Update the URL hash to provide immediate visual feedback + window.location.hash = href + + // Copy to clipboard + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(fullUrl).then(() => { + showCopyFeedback(linkElement) + }).catch(err => { + console.error('Failed to copy link: ', err) + fallbackCopyToClipboard(fullUrl, linkElement) + }) + } else { + // Fallback for older browsers + fallbackCopyToClipboard(fullUrl, linkElement) + } + } + + // Show visual feedback when link is copied + function showCopyFeedback(linkElement) { + const originalTitle = linkElement.getAttribute('title') + + linkElement.setAttribute('title', 'Copied!') + linkElement.classList.add('copied') + + setTimeout(() => { + linkElement.setAttribute('title', originalTitle) + linkElement.classList.remove('copied') + }, 2000) + } + + // Fallback copy method for older browsers + function fallbackCopyToClipboard(text, linkElement) { + const textArea = document.createElement('textarea') + textArea.value = text + textArea.style.position = 'fixed' + textArea.style.left = '-999999px' + textArea.style.top = '-999999px' + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + + try { + const successful = document.execCommand('copy') + if (successful) { + showCopyFeedback(linkElement) + console.log('Link copied to clipboard (fallback)') + } else { + console.error('Fallback copy failed') + } + } catch (err) { + console.error('Fallback copy failed: ', err) + } + + document.body.removeChild(textArea) + } + function allowFocus(selector, state) { const container = document.querySelector(selector) const focusable = container.querySelectorAll('button, [href], input, select, textarea') From 215076bad3c22808e289e54881dce2353c01e2c7 Mon Sep 17 00:00:00 2001 From: Mincho Paskalev Date: Tue, 8 Jul 2025 16:26:57 +0300 Subject: [PATCH 08/12] Fix docs about the A param of KSN config (#1803) * Fix docs about the A param of KSN config * Fix docs, excluding events from A param * final fix for ksn docs --- content/develop/pubsub/keyspace-notifications.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/develop/pubsub/keyspace-notifications.md b/content/develop/pubsub/keyspace-notifications.md index 549224c29b..9b8ee50a1f 100644 --- a/content/develop/pubsub/keyspace-notifications.md +++ b/content/develop/pubsub/keyspace-notifications.md @@ -82,11 +82,11 @@ following table: d Module key type events x Expired events (events generated every time a key expires) e Evicted events (events generated when a key is evicted for maxmemory) - m Key miss events (events generated when a key that doesn't exist is accessed) - n New key events (Note: not included in the 'A' class) - o Overwritten events (events generated every time a key is overwritten) - c Type-changed events (events generated every time a key's type changes) - A Alias for "g$lshztxed", so that the "AKE" string means all the events except "m" and "n". + m Key miss events generated when a key that doesn't exist is accessed (Note: not included in the 'A' class) + n New key events generated whenever a new key is created (Note: not included in the 'A' class) + o Overwritten events generated every time a key is overwritten (Note: not included in the 'A' class) + c Type-changed events generated every time a key's type changes (Note: not included in the 'A' class) + A Alias for "g$lshztdxe", so that the "AKE" string means all the events except "m", "n", "o" and "c". At least `K` or `E` should be present in the string, otherwise no event will be delivered regardless of the rest of the string. From 20259b6eb9e93b80de1503bc889844ce0388622a Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Wed, 9 Jul 2025 12:57:02 -0700 Subject: [PATCH 09/12] DOC-5457: add the new SVS-VAMANA vector algorithm type (#1822) * DOC-5457: add the new SVS-VAMANA vector algorithm type * Apply suggestions from code review Thank you, @mich-elle-luna! Co-authored-by: mich-elle-luna <153109578+mich-elle-luna@users.noreply.github.com> * Apply more suggestions from code review * Apply misspelling fix * Apply more suggestions from code review --------- Co-authored-by: mich-elle-luna <153109578+mich-elle-luna@users.noreply.github.com> --- .../indexing/field-and-type-options.md | 1 + .../develop/ai/search-and-query/vectors.md | 77 +++++++++++++++++-- static/resources/redisuniversity.yaml | 4 +- 3 files changed, 73 insertions(+), 9 deletions(-) diff --git a/content/develop/ai/search-and-query/indexing/field-and-type-options.md b/content/develop/ai/search-and-query/indexing/field-and-type-options.md index cb2033f2be..9941c7716a 100644 --- a/content/develop/ai/search-and-query/indexing/field-and-type-options.md +++ b/content/develop/ai/search-and-query/indexing/field-and-type-options.md @@ -157,6 +157,7 @@ Where: - `FLAT`: brute force algorithm. - `HNSW`: hierarchical, navigable, small world algorithm. + - `SVS-VAMANA`: a graph-based nearest neighbor search algorithm, which is optimized for use with compression methods to reduce its memory footprint. The `{algorithm}` attribute specifies the algorithm to use when searching `k` most similar vectors in the index or filtering vectors by range. diff --git a/content/develop/ai/search-and-query/vectors.md b/content/develop/ai/search-and-query/vectors.md index 0c9a590368..e09a0e5e04 100644 --- a/content/develop/ai/search-and-query/vectors.md +++ b/content/develop/ai/search-and-query/vectors.md @@ -25,7 +25,7 @@ To quickly get started, check out the [Redis vector quickstart guide]({{< relref ## Overview -1. [**Create a vector index**]({{< relref "develop/ai/search-and-query/vectors#create-a-vector-index" >}}): Redis maintains a secondary index over your data with a defined schema (including vector fields and metadata). Redis supports [`FLAT`]({{< relref "develop/ai/search-and-query/vectors#flat-index" >}}) and [`HNSW`]({{< relref "develop/ai/search-and-query/vectors#hnsw-index" >}}) vector index types. +1. [**Create a vector index**]({{< relref "develop/ai/search-and-query/vectors#create-a-vector-index" >}}): Redis maintains a secondary index over your data with a defined schema (including vector fields and metadata). Redis supports [`FLAT`]({{< relref "develop/ai/search-and-query/vectors#flat-index" >}}), [`HNSW`]({{< relref "develop/ai/search-and-query/vectors#hnsw-index" >}}) and [`SVS-VAMANA`]({{< relref "develop/ai/search-and-query/vectors#svs-vamana-index" >}}) vector index types. 1. [**Store and update vectors**]({{< relref "develop/ai/search-and-query/vectors#store-and-update-vectors" >}}): Redis stores vectors and metadata in hashes or JSON objects. 1. [**Search with vectors**]({{< relref "develop/ai/search-and-query/vectors#search-with-vectors" >}}): Redis supports several advanced querying strategies with vector fields including k-nearest neighbor ([KNN]({{< relref "develop/ai/search-and-query/vectors#knn-vector-search" >}})), [vector range queries]({{< relref "develop/ai/search-and-query/vectors#vector-range-queries" >}}), and [metadata filters]({{< relref "develop/ai/search-and-query/vectors#filters" >}}). 1. [**Configure vector queries at runtime**]({{< relref "develop/ai/search-and-query/vectors#runtime-query-params" >}}). @@ -106,12 +106,12 @@ Choose the `HNSW` index type when you have larger datasets (> 1M documents) or w [`HNSW`](https://arxiv.org/ftp/arxiv/papers/1603/1603.09320.pdf) supports a number of additional parameters to tune the accuracy of the queries, while trading off performance. -| Attribute | Description | -|:-------------------|:--------------------------------------------------------------------------------------------| -| `M` | Max number of outgoing edges (connections) for each node in a graph layer. On layer zero, the max number of connections will be `2 * M`. Higher values increase accuracy, but also increase memory usage and index build time. The default is 16. | -| `EF_CONSTRUCTION` | Max number of connected neighbors to consider during graph building. Higher values increase accuracy, but also increase index build time. The default is 200. | -| `EF_RUNTIME` | Max top candidates during KNN search. Higher values increase accuracy, but also increase search latency. The default is 10. | -| `EPSILON` | Relative factor that sets the boundaries in which a range query may search for candidates. That is, vector candidates whose distance from the query vector is `radius * (1 + EPSILON)` are potentially scanned, allowing more extensive search and more accurate results, at the expense of run time. The default is 0.01. | +| Attribute | Description | Default value | +|:-------------------|:-------------------------------------------------------------------|:-------------:| +| `M` | Max number of outgoing edges (connections) for each node in a graph layer. On layer zero, the max number of connections will be `2 * M`. Higher values increase accuracy, but also increase memory usage and index build time. | 16 | +| `EF_CONSTRUCTION` | Max number of connected neighbors to consider during graph building. Higher values increase accuracy, but also increase index build time. | 200 | +| `EF_RUNTIME` | Max top candidates during KNN search. Higher values increase accuracy, but also increase search latency. | 10 | +| `EPSILON` | Relative factor that sets the boundaries in which a range query may search for candidates. That is, vector candidates whose distance from the query vector is `radius * (1 + EPSILON)` are potentially scanned, allowing more extensive search and more accurate results, at the expense of run time. | 0.01 | **Example** @@ -129,6 +129,58 @@ FT.CREATE documents In the example above, an index named `documents` is created over hashes with the key prefix `docs:` and an `HNSW` vector field named `doc_embedding` with five index attributes: `TYPE`, `DIM`, `DISTANCE_METRIC`, `M`, and `EF_CONSTRUCTION`. +### SVS-VAMANA index + +Scalable Vector Search (SVS) is an Intel project featuring a graph-based vector search algorithm that is optimized to work with compression methods to reduce memory usage. You can read more about the project [here](https://intel.github.io/ScalableVectorSearch/intro.html). Support for SVS-VAMANA indexing was added in Redis 8.2. + +Choose the `SVS-VAMANA` index type when all of the following requirements apply: +- High search performance and scalability are more important than exact search accuracy (similar to HNSW) +- Reduced memory usage +- Performance optimizations for Intel hardware + +**Required attributes** + +| Attribute | Description | +|:-------------------|:-----------------------------------------| +| `TYPE` | Vector type (`FLOAT16` or `FLOAT32`). Note: `COMPRESSION` is supported with both types. | +| `DIM` | The width, or number of dimensions, of the vector embeddings stored in this field. In other words, the number of floating point elements comprising the vector. `DIM` must be a positive integer. The vector used to query this field must have the exact same dimensions as the field itself. | +| `DISTANCE_METRIC` | Distance metric (`L2`, `IP`, `COSINE`). | + +**Optional attributes** + +`SVS-VAMANA` supports a number of additional parameters to tune the accuracy of the queries. + +| Attribute | Description | Default value | +|:---------------------------|:-----------------------------------------|:-------------:| +| `COMPRESSION` | Compression algorithm (`LVQ8`, `LVQ4`, `LVQ4x4`, `LVQ4x8`, `LeanVec4x8`, or `LeanVec8x8`). Vectors will be compressed during indexing. See these Intel pages for best practices on using these algorithms: [`COMPRESSION` settings](https://intel.github.io/ScalableVectorSearch/howtos.html#compression-setting) and [`LeanVec`](https://intel.github.io/ScalableVectorSearch/python/experimental/leanvec.html). | None | +| `CONSTRUCTION_WINDOW_SIZE` | The search window size to use during graph construction. A higher search window size will yield a higher quality graph since more overall vertexes are considered, but will increase construction time. | 200 | +| `GRAPH_MAX_DEGREE` | The maximum node degree in the graph. A higher max degree may yield a higher quality graph in terms of recall for performance, but the memory footprint of the graph is directly proportional to the maximum degree. | 32 | +| `SEARCH_WINDOW_SIZE` | The size of the search window. Increasing the search window size and capacity generally yields more accurate but slower search results. | 10 | +| `EPSILON` | The range search approximation factor. | 0.01 | +| `TRAINING_THRESHOLD` | The number of vectors after which training is triggered. Applicable only when used with `COMPRESSION`. If a value is provided, it be less than `100 * DEFAULT_BLOCK_SIZE`, where `DEFAULT_BLOCK_SIZE` is 1024. | `10 * DEFAULT_BLOCK_SIZE` | +| `LEANVEC_DIM` | The dimension used when using `LeanVec4x8` or `LeanVec8x8` compression for dimensionality reduction. If a value is provided, it should be less than `DIM`. | `DIM / 2` | + +{{< warning >}} +On non-Intel platforms, `SVS-VAMANA` with `COMPRESSION` will fall back to Intel’s basic scalar quantization implementation. +{{< /warning >}} + +**Example** + +``` +FT.CREATE documents + ON HASH + PREFIX 1 docs: + SCHEMA doc_embedding VECTOR SVS-VAMANA 12 + TYPE FLOAT32 + DIM 1536 + DISTANCE_METRIC COSINE + GRAPH_MAX_DEGREE 40 + CONSTRUCTION_WINDOW_SIZE 250 + COMPRESSION LVQ8 +``` + +In the example above, an index named `documents` is created over hashes with the key prefix `docs:` and an `SVS-VAMANA` vector field named `doc_embedding` with six index attributes: `TYPE`, `DIM`, `DISTANCE_METRIC`, `GRAPH_MAX_DEGREE`, `CONSTRUCTION_WINDOW_SIZE` and `COMPRESSION`. + ### Distance metrics Redis supports three popular distance metrics to measure the degree of similarity between two vectors $u$, $v$ $\in \mathbb{R}^n$, where $n$ is the length of the vectors: @@ -378,6 +430,17 @@ Optional runtime parameters for HNSW indexes are: | `EF_RUNTIME` | The maximum number of top candidates to hold during the KNN search. Higher values lead to more accurate results at the expense of a longer query runtime. | The value passed during index creation. The default is 10. | | `EPSILON` | The relative factor that sets the boundaries for a vector range query. Vector candidates whose distance from the query vector is `radius * (1 + EPSILON)` are potentially scanned, allowing a more extensive search and more accurate results at the expense of runtime. | The value passed during index creation. The default is 0.01. | +**SVS-VAMANA** + +Optional runtime parameters for SVS-VAMANA indexes are: + +| Parameter | Description | Default value | +|:----------|:------------|:--------------| +| `SEARCH_WINDOW_SIZE` | The size of the search window (applies only to KNN searches). | 10 or the value that was passed upon index creation. | +| `EPSILON` | The range search approximation factor. | 0.01 or the value that was passed upon index creation. | +| `USE_SEARCH_HISTORY` | When building an index, either the contents of the search buffer is used or the entire search history is used. The latter case may yield a slightly better graph at the cost of more search time. Boolean options are `OFF`, `ON`, and `AUTO`. `AUTO` is always evaluated internally as `ON`. | `AUTO` | +| `SEARCH_BUFFER_CAPACITY` | A tuning parameter used in compressed `SVS-VAMANA` indexes, which are using a two-level compression type (`LVQx` or one of the `LeanVec` types), that determines the number of vector candidates to collect in the first level of the search, before the re-ranking level (which is the second level). | `SEARCH_WINDOW_SIZE` | + ### Important notes diff --git a/static/resources/redisuniversity.yaml b/static/resources/redisuniversity.yaml index d2ec3d78f4..ebd578faf6 100644 --- a/static/resources/redisuniversity.yaml +++ b/static/resources/redisuniversity.yaml @@ -63,6 +63,6 @@ links: text: See the [Get started with Redis Software learning path](https://university.redis.io/learningpath/an0mgw5bjpjfbe) for courses. # Redis Develop links - - page: /develop/interact/search-and-query/advanced-concepts/vectors + - page: /develop/ai/search-and-query/vectors text: See the [Introduction to vector search course](https://university.redis.io/course/yz1lretjfpdlew?tab=details) to learn more. - + \ No newline at end of file From bbd5fca215d289e08809e0e238129b62e2278269 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Thu, 24 Jul 2025 07:24:03 -0700 Subject: [PATCH 10/12] DOC-5491: add new CASE function and also augment the SVS_VAMANA changes with additional info (#1869) --- content/commands/ft.aggregate.md | 22 +++++++++++++ .../advanced-concepts/aggregations.md | 1 + .../develop/ai/search-and-query/vectors.md | 33 +++++++++++++++---- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/content/commands/ft.aggregate.md b/content/commands/ft.aggregate.md index 47aa2b4d28..ab8b8e83e0 100644 --- a/content/commands/ft.aggregate.md +++ b/content/commands/ft.aggregate.md @@ -489,6 +489,28 @@ Next, count GitHub events by user (actor), to produce the most active users.
  • +
    +Use the case function for conditional logic +{{< highlight bash >}} +//Simple mapping +FT.AGGREGATE products "*" +APPLY case(@price > 100, "premium", "standard") AS category + +//Nested conditions where an error should be returned +FT.AGGREGATE orders "*" +APPLY case(@status == "pending", + case(@priority == "high", 1, 2), + case(@status == "completed", 3, 4)) AS status_code + +//Mapped approach +FT.AGGREGATE orders "*" +APPLY case(@status == "pending", 1, 0) AS is_pending +APPLY case(@is_pending == 1 && @priority == "high", 1,2) AS status_high +APPLY case(@is_pending == 0 && @priority == "high", 3,4) AS status_completed +{{< / highlight >}} + +
    + ## See also [`FT.CONFIG SET`]({{< relref "commands/ft.config-set/" >}}) | [`FT.SEARCH`]({{< relref "commands/ft.search/" >}}) diff --git a/content/develop/ai/search-and-query/advanced-concepts/aggregations.md b/content/develop/ai/search-and-query/advanced-concepts/aggregations.md index 3813995e7a..d0a2e3f1b5 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/aggregations.md +++ b/content/develop/ai/search-and-query/advanced-concepts/aggregations.md @@ -379,6 +379,7 @@ Note that these operators apply only to numeric values and numeric sub-expressio | Function | Description | Example | | -------- | ------------------------------------------------------------ | ------------------ | | exists(s)| Checks whether a field exists in a document. | `exists(@field)` | +| case(condition, if_true, if_false) | If condition is non-zero, return if_true, otherwise return if_false. | `case(exists(@foo), @foo, "no foo")` | ### List of numeric APPLY functions diff --git a/content/develop/ai/search-and-query/vectors.md b/content/develop/ai/search-and-query/vectors.md index 27bd2a978b..b72153b61d 100644 --- a/content/develop/ai/search-and-query/vectors.md +++ b/content/develop/ai/search-and-query/vectors.md @@ -152,18 +152,39 @@ Choose the `SVS-VAMANA` index type when all of the following requirements apply: | Attribute | Description | Default value | |:---------------------------|:-----------------------------------------|:-------------:| -| `COMPRESSION` | Compression algorithm (`LVQ8`, `LVQ4`, `LVQ4x4`, `LVQ4x8`, `LeanVec4x8`, or `LeanVec8x8`). Vectors will be compressed during indexing. See these Intel pages for best practices on using these algorithms: [`COMPRESSION` settings](https://intel.github.io/ScalableVectorSearch/howtos.html#compression-setting) and [`LeanVec`](https://intel.github.io/ScalableVectorSearch/python/experimental/leanvec.html). | None | +| `COMPRESSION` | Compression algorithm; one of `LVQ8`, `LVQ4`, `LVQ4x4`, `LVQ4x8`, `LeanVec4x8`, or `LeanVec8x8`. Vectors will be compressed during indexing. See below for descriptions of each algorithm. Also, see these Intel pages for best practices on using these algorithms: [`COMPRESSION` settings](https://intel.github.io/ScalableVectorSearch/howtos.html#compression-setting) and [`LeanVec`](https://intel.github.io/ScalableVectorSearch/python/experimental/leanvec.html). | `LVQ4x4` | | `CONSTRUCTION_WINDOW_SIZE` | The search window size to use during graph construction. A higher search window size will yield a higher quality graph since more overall vertexes are considered, but will increase construction time. | 200 | -| `GRAPH_MAX_DEGREE` | The maximum node degree in the graph. A higher max degree may yield a higher quality graph in terms of recall for performance, but the memory footprint of the graph is directly proportional to the maximum degree. | 32 | -| `SEARCH_WINDOW_SIZE` | The size of the search window. Increasing the search window size and capacity generally yields more accurate but slower search results. | 10 | -| `EPSILON` | The range search approximation factor. | 0.01 | -| `TRAINING_THRESHOLD` | The number of vectors after which training is triggered. Applicable only when used with `COMPRESSION`. If a value is provided, it be less than `100 * DEFAULT_BLOCK_SIZE`, where `DEFAULT_BLOCK_SIZE` is 1024. | `10 * DEFAULT_BLOCK_SIZE` | -| `LEANVEC_DIM` | The dimension used when using `LeanVec4x8` or `LeanVec8x8` compression for dimensionality reduction. If a value is provided, it should be less than `DIM`. | `DIM / 2` | +| `GRAPH_MAX_DEGREE` | Sets the maximum number of edges per node; equivalent to `HNSW’s M*2`. A higher max degree may yield a higher quality graph in terms of recall for performance, but the memory footprint of the graph is directly proportional to the maximum degree. | 32 | +| `SEARCH_WINDOW_SIZE` | The size of the search window; the same as `HSNW's EF_RUNTIME`. Increasing the search window size and capacity generally yields more accurate but slower search results. | 10 | +| `EPSILON` | The range search approximation factor; the same as `HSNW's EPSILON`. | 0.01 | +| `TRAINING_THRESHOLD` | Number of vectors needed to learn compression parameters. Applicable only when used with `COMPRESSION`. Increase if recall is low. Note: setting this too high may slow down search.If a value is provided, it must be less than `100 * DEFAULT_BLOCK_SIZE`, where `DEFAULT_BLOCK_SIZE` is 1024. | `10 * DEFAULT_BLOCK_SIZE` | +| `LEANVEC_DIM` | The dimension used when using `LeanVec4x8` or `LeanVec8x8` compression for dimensionality reduction. If a value is provided, it should be less than `DIM`. Lowering it can speed up search and reduce memory use. | `DIM / 2` | {{< warning >}} On non-Intel platforms, `SVS-VAMANA` with `COMPRESSION` will fall back to Intel’s basic scalar quantization implementation. {{< /warning >}} +**SVS_VAMANA vector compression algorithms** + +LVQ is a scalar quantization method that applies scaling constants for each vector. LeanVec builds on this by combining query-aware dimensionality reduction with LVQ-based scalar quantization for efficient vector compression. + +`LVQ4x4` (the default): Fast search with 4x vector compression relative to float32-encoded vectors (8 bits per dimension) and high accuracy. + +`LeanVec4x8`: Recommended for high-dimensional datasets. It offers the fastest search and ingestion. It's not the default because in rare cases it may reduce recall if the data does not compress well. + +`LeanVec` dimensional: For faster search and lower memory use, reduce the dimension further (default is input `dim / 2`; try `dim / 4` or even higher reduction). + +`LVQ8`: Faster ingestion than the default, but with slower search. + +| Compression algorithm | Best for | +|-----------------------|----------| +| `LVQ4x4` (default) | Fast search in most cases with low memory use. | +| `LeanVec4x8` | Fastest search and ingestion. | +| `LVQ4` | Maximum memory savings. | +| `LVQ8` | Faster ingestion than the default. | +| `LeanVec8x8` | Improved recall in cases where `LeanVec4x8` is not sufficient. | +| `LVQ4x8` | Improved recall in cases where the default is not sufficient. | + **Example** ``` From 483e2354781e0624d7553cc6c9f639458ff22eec Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Mon, 28 Jul 2025 07:50:12 -0700 Subject: [PATCH 11/12] DOC-5495: modify vector set docs for 8.2 (initial commit) (#1875) * DOC-5495: modify vector set docs for 8.2 (initial commit) * Remove merge info * Added EPSILON info * Apply code review suggestions --- content/commands/vismember.md | 66 +++++++++++++++++++ content/commands/vrem.md | 8 +-- content/commands/vsim.md | 8 ++- .../develop/data-types/vector-sets/_index.md | 1 + 4 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 content/commands/vismember.md diff --git a/content/commands/vismember.md b/content/commands/vismember.md new file mode 100644 index 0000000000..4093d1e32f --- /dev/null +++ b/content/commands/vismember.md @@ -0,0 +1,66 @@ +--- +arguments: +- name: key + type: key +- name: element + type: string +arity: 3 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(1) +description: Check if an element exists in a vector set. +function: vismemberCommand +group: vector_set +hidden: false +linkTitle: VISMEMBER +since: 8.0.0 +summary: Check if an element exists in a vector set. +syntax_fmt: VISMEMBER key element +syntax_str: element +title: VISMEMBER +bannerText: Vector set is a new data type that is currently in preview and may be subject to change. +--- + +Check if an element exists in a vector set. + +## Required arguments + +
    +key + +is the name of the key that holds the vector set. +
    + +
    +element + +is the name of the element you want to check for membership. +
    + +## Related topics + +- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}) + +## Return information + +{{< multitabs id="vismember-return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): `0` if the element does not exist in the vector set, or the key does not exist. `1` if the element exists in the vector set. + +-tab-sep- + +[Boolean reply](../../develop/reference/protocol-spec#booleans): `false` if the element does not exist in the vector set, or the key does not exist. `true` if the element exists in the vector set. + +{{< /multitabs >}} diff --git a/content/commands/vrem.md b/content/commands/vrem.md index 444692b059..227c1e65e2 100644 --- a/content/commands/vrem.md +++ b/content/commands/vrem.md @@ -10,12 +10,12 @@ categories: - kubernetes - clients complexity: O(log(N)) for each element removed, where N is the number of elements in the vector set. -description: Remove one or more elements from a vector set. +description: Remove an element from a vector set. group: vector_set hidden: false linkTitle: VREM since: 8.0.0 -summary: Remove one or more elements from a vector set. +summary: Remove an element from a vector set. syntax_fmt: "VREM key element" title: VREM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. @@ -26,14 +26,10 @@ Remove an element from a vector set. ```shell VADD vset VALUES 3 1 0 1 bar (integer) 1 -``` -```shell VREM vset bar (integer) 1 -``` -```shell VREM vset bar (integer) 0 ``` diff --git a/content/commands/vsim.md b/content/commands/vsim.md index 9853b5c93c..78a568a3c8 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -19,7 +19,7 @@ history: linkTitle: VSIM since: 8.0.0 summary: Return elements by vector similarity. -syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]" +syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EPSILON delta] [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort]\n [TRUTH] [NOTHREAD]" title: VSIM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. --- @@ -99,6 +99,12 @@ returns, for each element, the JSON attribute associated with the element or NUL limits the number of returned results to `num`. +
    +EPSILON delta + +is a floating point number between 0 and 1. It is used to retrieve elements that have a distance that is no further than the specified `delta`. In vector sets, returned elements have a similarity score (when compared to the query vector) that is between 1 and 0, where 1 means identical and 0 means opposite vectors. For example, if the `EPSILON` option is specified with an argument of `0.2`, it means only elements that have a similarity of 0.8 or better (a distance < 0.2) are returned. This is useful when you specify a large `COUNT`, but you don't want elements that are too far away from the query vector. +
    +
    EF search-exploration-factor diff --git a/content/develop/data-types/vector-sets/_index.md b/content/develop/data-types/vector-sets/_index.md index f654418ff6..f730a52f60 100644 --- a/content/develop/data-types/vector-sets/_index.md +++ b/content/develop/data-types/vector-sets/_index.md @@ -33,6 +33,7 @@ The following commands are available for vector sets: - [VEMB]({{< relref "/commands/vemb" >}}) - retrieve the approximate vector associated with a vector set element. - [VGETATTR]({{< relref "/commands/vgetattr" >}}) - retrieve the attributes of a vector set element. - [VINFO]({{< relref "/commands/vinfo" >}}) - retrieve metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure. +- [VISMEMBER]({{< relref "/commands/vismember" >}}) - check if an element exists in a vector set. - [VLINKS]({{< relref "/commands/vlinks" >}}) - retrieve the neighbors of a specified element in a vector set; the connections for each layer of the HNSW graph. - [VRANDMEMBER]({{< relref "/commands/vrandmember" >}}) - retrieve random elements of a vector set. - [VREM]({{< relref "/commands/vrem" >}}) - remove an element from a vector set. From 030fe0ef66110db2c0714b8ce72d9b9f8506e9f0 Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Mon, 28 Jul 2025 08:38:46 -0700 Subject: [PATCH 12/12] DOC-5504: update modules API doc (#1882) --- .../reference/modules/modules-api-ref.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/content/develop/reference/modules/modules-api-ref.md b/content/develop/reference/modules/modules-api-ref.md index 6b1feba59d..c4aaf91cf9 100644 --- a/content/develop/reference/modules/modules-api-ref.md +++ b/content/develop/reference/modules/modules-api-ref.md @@ -5088,6 +5088,31 @@ write actions, please refer to [`RedisModule_AddPostNotificationJob`](#RedisModu See [https://redis.io/docs/latest/develop/use/keyspace-notifications/](https://redis.io/docs/latest/develop/use/keyspace-notifications/) for more information. + + +### `RedisModule_UnsubscribeFromKeyspaceEvents` + + int RedisModule_UnsubscribeFromKeyspaceEvents(RedisModuleCtx *ctx, + int types, + RedisModuleNotificationFunc callback); + +**Available since:** unreleased + + +[`RedisModule_UnsubscribeFromKeyspaceEvents`](#RedisModule_UnsubscribeFromKeyspaceEvents) - Unregister a module's callback from keyspace notifications for specific event types. + +This function removes a previously registered subscription identified by both the event mask and the callback function. +It is useful to reduce performance overhead when the module no longer requires notifications for certain events. + +Parameters: + - ctx: The `RedisModuleCtx` associated with the calling module. + - types: The event mask representing the keyspace notification types to unsubscribe from. + - callback: The callback function pointer that was originally registered for these events. + +Returns: + - `REDISMODULE_OK` on successful removal of the subscription. + - `REDISMODULE_ERR` if no matching subscription was found or if invalid parameters were provided. + ### `RedisModule_AddPostNotificationJob` @@ -8636,6 +8661,7 @@ There is no guarantee that this info is always available, so this may return -1. * [`RedisModule_UnblockClient`](#RedisModule_UnblockClient) * [`RedisModule_UnlinkKey`](#RedisModule_UnlinkKey) * [`RedisModule_UnregisterCommandFilter`](#RedisModule_UnregisterCommandFilter) +* [`RedisModule_UnsubscribeFromKeyspaceEvents`](#RedisModule_UnsubscribeFromKeyspaceEvents) * [`RedisModule_ValueLength`](#RedisModule_ValueLength) * [`RedisModule_WrongArity`](#RedisModule_WrongArity) * [`RedisModule_Yield`](#RedisModule_Yield)