Skip to content

Commit e68960e

Browse files
uglidedwdougherty
andauthored
Apply suggestions from code review
Co-authored-by: David Dougherty <[email protected]>
1 parent 3f80bcd commit e68960e

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

docs/reference/resp2-to-resp3-replies.md

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
---
2-
title: "RESP2 to RESP3 replies migration guide"
2+
title: "RESP2 to RESP3 reply migration guide"
33
linkTitle: "RESP2 to RESP3 migration"
44
weight: 4
5-
description: RESP2 to RESP3 replies reference for clients developers
5+
description: RESP2 to RESP3 reply reference for client library developers
66
aliases:
77
- /topics/resp2-to-resp3-replies/
88
---
99

10-
In the journey from RESP2 to [RESP3](https://redis.io/docs/reference/protocol-spec/), one of the primary motivations was to streamline the developer experience by simplifying response parsing.
11-
Over time, it became evident that developers frequently performed specific data transformations on RESP2 replies, which required hardcoded transformations per command.
12-
Addressing these transformations directly at the protocol level reduces clients' overhead and ensures a more consistent and efficient replies handling process.
13-
This documentation provides a reference for developers to migrate their clients from RESP2 to RESP3.
10+
The primary motivation for creating the [RESP3](https://redis.io/docs/reference/protocol-spec/) protocol, the successor to RESP2, was to streamline the developer experience by simplifying response parsing.
11+
It became evident that developers frequently performed specific data transformations on RESP2 replies, which required hardcoded transformations for each command.
12+
Addressing these transformations directly at the protocol level reduces client overhead and ensures a more consistent and efficient reply-handling process.
13+
This documentation provides a reference guide to help developers migrate their clients from RESP2 to RESP3.
1414

15-
### Command Replies Comparison
16-
- RESP3 introduces many new [simple types and aggregates]((https://redis.io/docs/reference/protocol-spec/#resp-protocol-description)).
17-
The following tables compare only commands with non-trivial changes in replies, primarily for new aggregates introduced in RESP3 that require major changes in the client implementation.
15+
**Note**:
16+
> Each of the Redis base command manual pages now includes both RESP2 and RESP3 responses.
17+
18+
### Command replies comparison
19+
- RESP3 introduces many new [simple and aggregate reply types]((https://redis.io/docs/reference/protocol-spec/#resp-protocol-description)).
20+
The following tables compare only commands with non-trivial changes to their replies, primarily for new aggregates introduced in RESP3 that require major changes in the client implementation.
1821
- The types are described using [“TypeScript like” syntax](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html):
19-
- `[a, b]` stands for [a tuple](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) where we know the exact number of elements and types at specific positions.
20-
- `Array<a>` stands for [an array](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#arrays) where we know the type of elements but not the number of elements.
22+
- `[a, b]` stands for [a tuple](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) where the exact number of elements and types at specific positions are known.
23+
- `Array<a>` stands for [an array](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#arrays) where the type of elements is known but not the number of elements.
2124

22-
### Cluster Management
25+
### Cluster management
2326
| Command | RESP2 Reply | RESP3 Reply |
2427
|----------------|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
2528
| CLUSTER SLOTS | Array<\[number, number, ...\[BlobString, number, BlobString, Array]]> | Array<\[number, number, ...\[BlobString, number, BlobString, Map\<BlobString, BlobString>]]> |
@@ -51,13 +54,13 @@ The following tables compare only commands with non-trivial changes in replies,
5154
| HGETALL | Array | Map |
5255
| HRANDFIELD WITHVALUE | Array\<BlobString> | Array<\[BlobString, BlobString]> |
5356

54-
### Scripting and Functions
57+
### Scripting and functions
5558
| Command | RESP2 Reply | RESP3 Reply |
5659
|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
5760
| FUNCTION LIST | Array<\[‘library\_name’, BlobString, ‘engine’, BlobString, ‘functions’, Array<\[‘name’, BlobString, ‘description’, BlobString &#124; null, ‘flags’, Array\<BlobString>]>]> | Array<\[{ library\_name: BlobString, engine: BlobString, functions: Array<{ name: BlobString, description: BlobString &#124; null, flags: Set\<BlobString> }> }]> |
5861
| FUNCTION LIST WITHCODE | Array<\[‘library\_name’, BlobString, ‘engine’, BlobString, ‘functions’, Array<\[‘name’, BlobString, ‘description’, BlobString &#124; null, ‘flags’, Array\<BlobString>]>, ‘library\_code’, BlobString]> | Array<\[{ library\_name: BlobString, engine: BlobString, functions: Array<{ name: BlobString, description: BlobString &#124; null, flags: Set\<BlobString> }>, library\_code: BlobString }]> |
5962

60-
### Server Management
63+
### Server management
6164
| Command | RESP2 Reply | RESP3 Reply |
6265
|---------------|-------------------------------------------------------------------------------------------------------------|----------------------------------------------|
6366
| MODULE LIST | Array<\[BlobString<‘name’>, BlobString, BlobString<‘version’>, number]> | Array<{ name: BlobString, version: number }> |
@@ -83,7 +86,7 @@ The following tables compare only commands with non-trivial changes in replies,
8386
|----------------------------------------------------------------------|-------------|-------------|
8487
| SINTER <br/>SPOP COUNT<br/>SMEMBERS<br/>SRANDMEMBER COUNT<br/>SUNION | Array | Set |
8588

86-
### Sorted Set
89+
### Sorted set
8790
| Command | RESP2 Reply | RESP3 Reply |
8891
|--------------------------|-------------------------------------------------------------|---------------------------------------------------------|
8992
| ZADD INCR | BlobString | Double |

0 commit comments

Comments
 (0)