Neurotransmitter
Neurotransmitter

Reputation: 6827

Subscribe to data store changes in Workers KV

Cloudflare Workers KV is an eventually consistent data store. You can write values assigned to keys, and you can read values by key from it. But is there any possibility to listen to some key's value?

In a regular relational DB you can subscribe to changes of an individual row, but are there any similar options for KV?

Upvotes: 0

Views: 656

Answers (1)

Brett
Brett

Reputation: 848

There is currently no built-in listen.

You could poll keys for changes, which would probably only make sense if you had a small number of keys. (You can list keys to iterate over them.)

But, since you're the owner of your KV namespace, the best option is probably to wrap your write operations so that you notify some other service/queue that a change has been made.

Upvotes: 1

Related Questions