Should I use KV store as my source of truth

Hi,

I’m using Cloudflare workers to generate AppKeys for my application, and I store them in the KV store.
My question is whether you think that this store is generally good to be the source of truth for my data (specifically app keys in this case, but the question applies to any data), or should I use some other database and keep cloudflare KV only as cache?

Thanks

It depends a bit on your use case, but personally I usually use a other database as you may run into race conditions with Cloudflare’s KV as it may take up to 60 seconds for any changes to fully propagate globally.

3 Likes

I’d suggest using something like FaunaDB instead, if you don’t want to trust Fauna you can encrypted the content using WebCrypto API.

In general, we consider KV as durable as any sort of cloud storage. That is, if you would consider putting it in Google Cloud Storage or S3 or whatever to be good enough, it would also be good enough in KV.

Mission-critical data should always be stored redundantly in totally different systems, IMHO. All software is fallible in the end.