Skip to content

Commit 4abac23

Browse files
committed
Merge branch 'main' into DOC-4137
2 parents 49d1f54 + 99053d0 commit 4abac23

File tree

46 files changed

+360
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+360
-78
lines changed

content/commands/info/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,24 @@ It won't be included when `INFO` or `INFO ALL` are called, and it is returned on
515515
**A note about the word slave used in this man page**: Starting with Redis 5, if not for backward compatibility, the Redis project no longer uses the word slave. Unfortunately in this command the word slave is part of the protocol, so we'll be able to remove such occurrences only when this API will be naturally deprecated.
516516

517517
**Modules generated sections**: Starting with Redis 6, modules can inject their information into the `INFO` command. These are excluded by default even when the `all` argument is provided (it will include a list of loaded modules but not their generated info fields). To get these you must use either the `modules` argument or `everything`.
518+
519+
## Redis Software and Redis Cloud compatibility
520+
521+
| Redis<br />Enterprise | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
522+
|:----------------------|:-----------------|:------|
523+
| <span title="Supported">&#x2705; Standard</span><br /><span title="Supported"><nobr>&#x2705; Active-Active</nobr></span> | <span title="Supported">&#x2705; Standard</span><br /><span title="Supported"><nobr>&#x2705; Active-Active</nobr></span> | In Redis Enterprise, `INFO` returns a different set of fields than Redis Community Edition.<br />Not supported for [scripts]({{<relref "/develop/interact/programmability">}}). |
524+
525+
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.
526+
527+
Additionally, for JSON keys, Redis implements a “shared string” mechanism to save memory when the same JSON field names or field values of type string are used more than once (either inter-key or intra-key).
528+
In such cases, instead of storing the field names or values many times, Redis stores them only once. This mechanism is not in place for active-active databases.
529+
530+
On non-active-active databases, `INFO` (Memory > used_memory) reports that the shared memory is counted, but only once for all keys. On active-active databases, there is no shared memory, so if strings are repeated, they are stored multiple times.
531+
532+
**Example**
533+
534+
Suppose you have ten JSON keys, and each key has 5KB of unique content and 5KB of shared content.
535+
536+
For non-active-active databases, `INFO` (used_memory) would report (10 keys * 5KB) + 5KB ~= 55KB. The last term, "+ 5KB", is the size of the shared content.
537+
538+
For active-active databases, `INFO` (used_memory) would report 10 keys * 20KB ~= 200KB. This number includes some amount of CRDB overhead per JSON key.

content/commands/memory-usage/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,11 @@ OK
8787
> MEMORY USAGE foo3
8888
(integer) 160
8989
```
90+
91+
## Redis Software and Redis Cloud compatibility
92+
93+
| Redis<br />Enterprise | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
94+
|:----------------------|:-----------------|:------|
95+
|<span title="Supported">&#x2705; Standard</span><br /><span title="Supported"><nobr>&#x2705; Active-Active</nobr></span> | <span title="Supported">&#x2705; Standard</span><br /><span title="Supported"><nobr>&#x2705; Active-Active</nobr></span> | Not supported for [scripts]({{<relref "/develop/interact/programmability">}}) in Redis versions earlier than 7. |
96+
97+
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.

content/develop/connect/clients/_index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Redis does not support directly:
3939
| Language | Client name | Github | Docs |
4040
| :-- | :-- | :-- | :-- |
4141
| C | hiredis | https://github.com/redis/hiredis | https://github.com/redis/hiredis |
42-
| [PHP](https://www.php.net/) | predis | https://github.com/predis/predis | https://github.com/predis/predis/wiki |
42+
| [PHP](https://www.php.net/) | redis extension | https://github.com/phpredis/phpredis | https://github.com/phpredis/phpredis/blob/develop/README.md |
43+
| [PHP](https://www.php.net/) | predis library | https://github.com/predis/predis | https://github.com/predis/predis/wiki |
4344
| [Ruby](https://www.ruby-lang.org/en/) | redis-rb | https://github.com/redis/redis-rb | https://rubydoc.info/gems/redis |
4445
| [Rust](https://www.rust-lang.org/) | redis-rs | https://github.com/redis-rs/redis-rs | https://docs.rs/redis/latest/redis/ |
4546

@@ -52,4 +53,4 @@ To interact with a Redis server without writing code, use the
5253
[Redis CLI]({{< relref "/develop/connect/cli" >}}) and
5354
[Redis Insight]({{< relref "/develop/connect/insight" >}}) tools.
5455

55-
## Client library guides
56+
## Client library guides

content/develop/connect/insight/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ These are the locations on supported platforms:
159159
You can install Redis Insight on operating systems that are not officially supported, but it may not behave as expected.
160160
{{< /note >}}
161161

162+
## Redis Insight API (only for Docker)
163+
164+
If you are running Redis Insight from [Docker]({{< relref "/operate/redisinsight/install/install-on-docker" >}}),
165+
you can access the API from `http://localhost:5540/api/docs`.
166+
162167
## Feedback
163168

164169
To provide your feedback, [open a ticket in our Redis Insight repository](https://github.com/Redis-Insight/Redis-Insight/issues/new).

content/develop/data-types/sorted-sets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ As you can see [`ZADD`]({{< relref "/commands/zadd" >}}) is similar to [`SADD`](
5757
[`ZADD`]({{< relref "/commands/zadd" >}}) is also variadic, so you are free to specify multiple score-value
5858
pairs, even if this is not used in the example above.
5959

60-
With sorted sets it is trivial to return a list of hackers sorted by their
60+
With sorted sets it is trivial to return a list of racers sorted by their
6161
birth year because actually *they are already sorted*.
6262

6363
Implementation note: Sorted sets are implemented via a
@@ -163,7 +163,7 @@ Redis instance will reply with the same output).
163163
The main commands to operate with lexicographical ranges are [`ZRANGEBYLEX`]({{< relref "/commands/zrangebylex" >}}),
164164
[`ZREVRANGEBYLEX`]({{< relref "/commands/zrevrangebylex" >}}), [`ZREMRANGEBYLEX`]({{< relref "/commands/zremrangebylex" >}}) and [`ZLEXCOUNT`]({{< relref "/commands/zlexcount" >}}).
165165

166-
For example, let's add again our list of famous hackers, but this time
166+
For example, let's add again our list of famous racers, but this time
167167
using a score of zero for all the elements. We'll see that because of the sorted sets ordering rules, they are already sorted lexicographically. Using [`ZRANGEBYLEX`]({{< relref "/commands/zrangebylex" >}}) we can ask for lexicographical ranges:
168168

169169
{{< clients-example ss_tutorial zadd_lex >}}

content/develop/interact/search-and-query/query/aggregation.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Here is a more detailed explanation of the query syntax:
4646

4747
The following example shows you how to calculate a discounted price for new bicycles:
4848

49-
```
49+
{{< clients-example query_agg agg1 >}}
5050
FT.AGGREGATE idx:bicycle "@condition:{new}" LOAD 2 "__key" "price" APPLY "@price - (@price * 0.1)" AS "discounted"
51-
```
51+
{{< /clients-example >}}
5252

5353
The field `__key` is a built-in field.
5454

@@ -92,9 +92,9 @@ Here is an explanation of the additional constructs:
9292

9393
The following query shows you how to group by the field `condition` and apply a reduction based on the previously derived `price_category`. The expression `@price<1000` causes a bicycle to have the price category `1` if its price is lower than 1000 USD. Otherwise, it has the price category `0`. The output is the number of affordable bicycles grouped by price category.
9494

95-
```
95+
{{< clients-example query_agg agg2 >}}
9696
FT.AGGREGATE idx:bicycle "*" LOAD 1 price APPLY "@price<1000" AS price_category GROUPBY 1 @condition REDUCE SUM 1 "@price_category" AS "num_affordable"
97-
```
97+
{{< /clients-example >}}
9898

9999
```
100100
1) "3"
@@ -123,9 +123,9 @@ You can't use an aggregation function outside of a `GROUPBY` clause, but you can
123123

124124
Here is an example that adds a type attribute `bicycle` to each document before counting all documents with that type:
125125

126-
```
126+
{{< clients-example query_agg agg3 >}}
127127
FT.AGGREGATE idx:bicycle "*" APPLY "'bicycle'" AS type GROUPBY 1 @type REDUCE COUNT 0 AS num_total
128-
```
128+
{{< /clients-example >}}
129129

130130
The result is:
131131

@@ -143,28 +143,28 @@ It's sometimes necessary to group your data without applying a mathematical aggr
143143

144144
The following example shows how to group all bicycles by `condition`:
145145

146-
```
147-
FT.AGGREGATE idx:bicycle "*" LOAD 1 "__key" GROUPBY 1 "@condition" REDUCE TOLIST 1 "__key" AS bicylces
148-
```
146+
{{< clients-example query_agg agg4 >}}
147+
FT.AGGREGATE idx:bicycle "*" LOAD 1 "__key" GROUPBY 1 "@condition" REDUCE TOLIST 1 "__key" AS bicycles
148+
{{< /clients-example >}}
149149

150150
The output of this query is:
151151

152152
```
153153
1) "3"
154154
2) 1) "condition"
155155
1) "refurbished"
156-
2) "bicylces"
156+
2) "bicycles"
157157
3) 1) "bicycle:9"
158158
3) 1) "condition"
159159
1) "used"
160-
2) "bicylces"
160+
2) "bicycles"
161161
3) 1) "bicycle:1"
162162
1) "bicycle:2"
163163
2) "bicycle:3"
164164
3) "bicycle:4"
165165
4) 1) "condition"
166166
1) "new"
167-
2) "bicylces"
167+
2) "bicycles"
168168
3) 1) "bicycle:0"
169169
1) "bicycle:5"
170170
2) "bicycle:6"

content/develop/use/patterns/indexes/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,36 @@ Redis is not exactly a key-value store, since values can be complex data structu
1919

2020
This document explains how it is possible to create indexes in Redis using the following data structures:
2121

22+
* Hashes and JSON documents, using a variety of field types; used in conjunction with the Redis query engine.
2223
* Sorted sets to create secondary indexes by ID or other numerical fields.
2324
* Sorted sets with lexicographical ranges for creating more advanced secondary indexes, composite indexes and graph traversal indexes.
2425
* Sets for creating random indexes.
2526
* Lists for creating simple iterable indexes and last N items indexes.
27+
* Time series with labels.
2628

2729
Implementing and maintaining indexes with Redis is an advanced topic, so most
2830
users that need to perform complex queries on data should understand if they
2931
are better served by a relational store. However often, especially in caching
3032
scenarios, there is the explicit need to store indexed data into Redis in order to speedup common queries which require some form of indexing in order to be executed.
3133

34+
## Hashes and JSON indexes
35+
36+
The Redis query engine provides capabilities to index and query both hash and JSON keys using a variety of field types:
37+
38+
* `TEXT`
39+
* `TAG`
40+
* `NUMERIC`
41+
* `GEO`
42+
* `VECTOR`
43+
* `GEOSHAPE`
44+
45+
Once hash or JSON keys have been indexed using the [`FT.CREATE`]({{< baseurl >}}/commands/ft.create) command, all keys that use the prefix defined in the index can be queried using the [`FT.SEARCH`]({{< baseurl >}}/commands/ft.search) and [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate) commands.
46+
47+
For more information on creating hash and JSON indexes, see the following pages.
48+
49+
* [Hash indexes]({{< relref "/develop/interact/search-and-query/basic-constructs/schema-definition" >}})
50+
* [JSON indexes]({{< relref "/develop/interact/search-and-query/indexing" >}})
51+
3252
## Simple numerical indexes with sorted sets
3353

3454
The simplest secondary index you can create with Redis is by using the
@@ -158,6 +178,14 @@ When representing much larger numbers, you need a different form of indexing
158178
that is able to index numbers at any precision, called a lexicographical
159179
index.
160180

181+
## Time series indexes
182+
183+
When you create a new time series using the [`TS.CREATE`]({{< baseurl >}}/commands/ts.create) command, you can associate one or more `LABELS` with it. Each label is a name-value pair, where the both name and value are text. Labels serve as a secondary index that allows you to execute queries on groups of time series keys using various time series commands.
184+
185+
See the [time series quickstart guide]({{< relref "/develop/data-types/timeseries/quickstart#labels" >}}) for an example of creating a time series with a label.
186+
187+
The [`TS.MGET`]({{< baseurl >}}/commands/ts.mget), [`TS.MRANGE`]({{< baseurl >}}/commands/ts.mrange), and [`TS.MREVRANGE`]({{< baseurl >}}/commands/ts.mrevrange) commands operate on multiple time series based on specified labels or using a label-related filter expression. The [`TS.QUERYINDEX`]({{< baseurl >}}/commands/ts.queryindex) command returns all time series keys matching a given label-related filter expression.
188+
161189
## Lexicographical indexes
162190

163191
Redis sorted sets have an interesting property. When elements are added

content/embeds/rc-tags-tag-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ You can select the tag's **Key** and **Value** from the suggestions, or you can
33
{{<image filename="images/rc/tags-new-tag.png" alt="The New tag fields." >}}
44

55
A valid tag must follow these guidelines:
6-
- Tag keys must be between 2 and 64 characters long, and values must be at least 2 characters long.
6+
- Tag keys must be between 1 and 64 characters long, and values must be at least 1 character long.
77
- Tags can only have lowercase letters, numbers, spaces, and these special characters: `-`, `_`, `.`, `+`, `@`, and `:`.
88

99
After you add your first tag, you can:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
Title: Add the opcode to the Redis output
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
- rdi
9+
description: null
10+
group: di
11+
linkTitle: Add the opcode to the Redis output
12+
summary: Redis Data Integration keeps Redis in sync with the primary database in near
13+
real time.
14+
type: integration
15+
weight: 100
16+
---
17+
18+
In the example below, the data is captured from the source table named `employee` and is written to the Redis database as a JSON document. When you specify the `data_type` parameter for the job, it overrides the system-wide setting `target_data_type` defined in `config.yaml`.
19+
20+
Here, the result will be Redis JSON documents with fields captured from the source table
21+
(`employeeid`, `firstname`, `lastname`) and also with
22+
an extra field `my_opcode` added using the `merge` update strategy (see the
23+
[JSON job example]({{< relref "/integrate/redis-data-integration/data-pipelines/transform-examples/redis-json-example" >}})
24+
for more information). The `opcode` expression refers to the operation code captured from
25+
the source. This is a database-specific value that indicates which type of operation generated
26+
the change (insert, update, etc).
27+
28+
```yaml
29+
source:
30+
schema: public
31+
table: employee
32+
row_format: full
33+
transform:
34+
- uses: add_field
35+
with:
36+
field: after.my_opcode
37+
expression: opcode
38+
language: jmespath
39+
output:
40+
- uses: redis.write
41+
with:
42+
data_type: json
43+
mapping:
44+
- employeeid
45+
- firstname
46+
- lastname
47+
- my_opcode
48+
connection: target
49+
on_update: merge
50+
```

content/integrate/redis-data-integration/faq.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ weight: 50
2222
You must purchase a commercial license for RDI with Redis Enterprise. This includes two extra
2323
Redis Enterprise shards (primary and replica) for the staging database.
2424

25-
## Does RDI have any external dependencies?
26-
27-
RDI is packaged with all of its dependencies except for two dependencies that
28-
you need if you use IBM Db2 as a source:
29-
30-
- [Db2 JDBC driver](https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads)
31-
- [IBM Infopshere Data Replication license](https://www.ibm.com/docs/en/db2/10.5?topic=information-licensing-replication)
32-
3325
## How does RDI track data changes in the source database?
3426

3527
RDI uses mechanisms that are specific for each of the supported

0 commit comments

Comments
 (0)