Skip to content

Commit d02e08a

Browse files
authoredMay 27, 2024
feat(kv): enable auto pipelining by default (#680)
* feat(kv): enable auto pipelining by default BREAKING CHANGE: auto pipelining is on by default now, see https://upstash.com/docs/oss/sdks/ts/redis/pipelining/auto-pipeline. This brings performance benefits to any code making multiple redis commands simultaneously. If you detect bugs because of this, please open them at https://github.com/vercel/storage/issues. You can disable this new behavior with: ```js import { createClient } from '@vercel/kv'; const kv = createClient({ url: .., token: .., enableAutoPipelining: false }); ``` * changeset * update changeset * upgrade redis
1 parent b0b2164 commit d02e08a

File tree

5 files changed

+263
-14
lines changed

5 files changed

+263
-14
lines changed
 

‎.changeset/rare-poems-try.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
"@vercel/kv": major
3+
---
4+
5+
We're making this a major release for safety but we believe
6+
most applications can upgrade from 1.0.1 to 2 without any changes.
7+
Auto pipelining should work by default and improve performance.
8+
9+
BREAKING CHANGE: Auto pipelining is on by default now, see
10+
https://upstash.com/docs/oss/sdks/ts/redis/pipelining/auto-pipeline. This
11+
brings performance benefits to any code making multiple redis commands
12+
simultaneously.
13+
14+
If you detect bugs because of this, please open them at
15+
https://github.com/vercel/storage/issues.
16+
17+
You can disable this new behavior with:
18+
```js
19+
import { createClient } from '@vercel/kv';
20+
21+
const kv = createClient({
22+
url: ..,
23+
token: ..,
24+
enableAutoPipelining: false
25+
});
26+
```

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"publint": "0.2.7",
4141
"ts-jest": "29.1.2",
4242
"turbo": "1.12.4",
43-
"typescript": "^5.3.3"
43+
"typescript": "5.3.3"
4444
},
4545
"packageManager": "pnpm@8.15.3",
4646
"engines": {

‎packages/kv/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"testEnvironment": "node"
4444
},
4545
"dependencies": {
46-
"@upstash/redis": "1.25.2"
46+
"@upstash/redis": "^1.31.3"
4747
},
4848
"devDependencies": {
4949
"@changesets/cli": "2.27.1",

‎packages/kv/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export function createClient(config: RedisConfigNodejs): VercelKV {
8181
// The Next.js team recommends no value or `default` for fetch requests's `cache` option
8282
// upstash/redis defaults to `no-store`, so we enforce `default`
8383
cache: 'default',
84+
enableAutoPipelining: true,
8485
...config,
8586
});
8687
}

0 commit comments

Comments
 (0)