
Building a To-Do List with Cloudflare Workers and KV - soheilpro
https://blog.cloudflare.com/building-a-to-do-list-with-workers-and-kv/
======
steveklabnik
Workers KV went out of beta today, and this is a great tutorial on building a
small application entirely at the edge, with Workers for the code, and KV for
the data.

I'm the new PM on KV; I'm happy to answer any questions about any of this!

~~~
tadeusz_wojcik
I've got small app that is using KV as poor-man time series db and wonder how
could I still use it without too much cost. Currently it's writing 50 times
per minute every minute, but with bulk write I could write only five times
instead.

Given that writes aren't free in GA, I wonder how do you calculate requests,
in particular are batch writes counted as single request?

Do you plan exposing more worker friendly way of batch write?

Do you have any plans about atomic counters (could be really useful for rate
limiting, abuse control etc)?

Do you plan adding list/range operations for KV?

~~~
steveklabnik
Yeah, I guess (if I got my math right) that'd be $10/month for the writes, 2.1
million per month, first million free, and you'd just go over an extra
million.

> are batch writes counted as single request?

Batch write is more of a convenience thing than a cost saving thing; it's
billed the same way as if you'd done each write individually.

> Do you plan exposing more worker friendly way of batch write?

Possibly, if there's demand for it. As with any platform, you build a thing,
people use it, and sometimes you don't imagine the ways that they use it.

> Do you have any plans about atomic counters (could be really useful for rate
> limiting, abuse control etc)?

I agree that this is a feature that would certainly be very useful; I'd like
to have it but can't make any promises, of course.

> Do you plan adding list/range operations for KV?

The API does have a list call: [https://api.cloudflare.com/#workers-kv-
namespace-list-a-name...](https://api.cloudflare.com/#workers-kv-namespace-
list-a-namespace-s-keys)

There's no convenient wrapper for it inside of the worker; this is something
people want, so we'll see!

~~~
tadeusz_wojcik
Thanks! Appreciate detailed response, all makes sense. One thing I forgot and
I'd also love to see is some kind of backup/restore support.

~~~
steveklabnik
Oh I messed up the pricing above, it’s not in $5 increments, it’s per call. So
it will be fifty cents for that extra 100k, not $5. Oops! This is why the
computers do the billing.

Backup/restore would be cool! I’ll put that in the “ideas” bucket.

