workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Custom persistence path for KV

Open hpohlmeyer opened this issue 3 years ago • 1 comments

Describe the solution

Currently persistence is supported through the --experimental-enable-local-persistence flag. By default it will be persisted to <cwd>/wrangler-local-state.

This is a problem, when you try to share the KV between muliple workers. Say one worker writes to KV and another reads form it. They will both create their own persistent storage. This could be fixed by pointing them to the same directory.

That feature is already implemented in miniflare by adding as custom persistence path. The API for Wrangler would look similar. E.g. --experimental-enable-local-persistence="../../kv".

hpohlmeyer avatar Jul 13 '22 10:07 hpohlmeyer

This is a good usecase. I think we could do this.

threepointone avatar Jul 14 '22 11:07 threepointone

Looks like this has been implemented with https://github.com/cloudflare/wrangler2/pull/1644 in v2.1.3. Thank you! 🥳

hpohlmeyer avatar Nov 07 '22 13:11 hpohlmeyer