
Cloudflare Workers - taytus
https://workers.cloudflare.com/
======
rita3ko
Hi! I'm the PM for Cloudflare Workers. Happy to answer any questions about our
announcements, or Workers in general.

~~~
yeppie
Do you have plans to provide a Workers KV interface that would allow us to
search for keys, as well as view, modify and create new KV entries?

Also, it's currently only possible to avoid leaking that multiple websites
belong to the same entity by creating multiple Cloudflare accounts due to the
nameservers. This means that if we want to use Cloudflare workers for our 5
unique nameservers, then we would have to do a lot of unnecessary duplication.
So on a somewhat unrelated note, do you have any plans to add support for
adding additional nameservers to a Cloudflare account (this is currently
holding us back from using Workers over Lambda, and it's something we would
gladly pay for).

~~~
judge2020
> additional nameservers to a Cloudflare account

The price point may not be ideal but Business plan websites can set up branded
subdomains (eg ns1.example.com, ns2.example.com).

Also, there are a limited amount of nameservers (2550 possible combinations
with 50 male and 51 female nameservers I believe), so there’s probably a few
thousand other accounts with the same combination of nameservers as you. This
can still be a problem though, if you use a less-common TLD and/or you use
pages with similar content.

You could try using the API to automate this across multiple accounts
[https://api.cloudflare.com](https://api.cloudflare.com).

~~~
yeppie
It's definitely a problem for us, although it's fewer nameservers than I
expected :)

No idea how I missed custom nameservers on business plan.. Hope it's something
they added this year, otherwise I feel quite embarrassed.. It's too pricey for
personal use (since the plans are associated with websites and not accounts)
but the company will probably upgrade a few of the websites, thanks!

------
JackC
I love the idea of Workers! The catch I ran into last year was the 1MB limit
for webpacked JS files. That puts many npm packages off limits -- I ended up
doing some webpack magic to stub out subdependencies I didn't need from a
package that didn't support tree shaking, which is pretty far from "just
works."

Here's a good thread where the problem package was a SOAP library depending on
"request," but the same logic is easy to run into with any app:
[https://community.cloudflare.com/t/worker-size-limit-a-
probl...](https://community.cloudflare.com/t/worker-size-limit-a-
problem/24849)

The upshot is if you have an idea that would be easy with dependencies, you
can't reason about how difficult/possible it will be with Workers until you
spend some time figuring out if the dependencies can be compressed small
enough to use -- and the answer may change partway through if you need to add
something.

~~~
avidal
While we haven't relaxed the 1MB restriction, we _have_ made some changes to
the way we compress and distribute your code to the edge. I'd encourage you to
try again, and our new CLI[0] handles the webpacking for you.

[0] [https://workers.cloudflare.com/docs/quickstart/cli-
setup/](https://workers.cloudflare.com/docs/quickstart/cli-setup/)

------
mjlee
I love the CLI example! Probably the best way I've seen that presented (hint,
mouseover to copy/paste.)

------
larzang
We tried using a worker for a bit, and while it's mostly very convenient, the
request/response cache API does NOT support Vary headers, which was a major
dealbreaker for us.

~~~
rita3ko
We can probably help. Vary is usually intended to shard the cache based on
parts of the request. You can do the same with the cache API - modify the
cache key (quite similar to the example for caching the POST request
([https://workers.cloudflare.com/docs/reference/workers-
concep...](https://workers.cloudflare.com/docs/reference/workers-
concepts/using-cache/)), as you modify cache key to match the POST body).

------
orliesaurus
Took them about a year but there is finally a free tier!

~~~
avidal
We're excited about it also :)

------
jgrahamc
Announcement is here: [https://blog.cloudflare.com/just-write-code-improving-
develo...](https://blog.cloudflare.com/just-write-code-improving-developer-
experience-for-cloudflare-workers/)

~~~
stingraycharles
What I always wonder about is how one can write "non-trivial" stuff using
CloudFlare workers. Don't get me wrong, I am more than intrigued by the
concept, but as far as I understand, it cannot do things like connecting to a
database or third party service. That makes the types of problems you can
solve with it relatively small.

This is confirmed what I see if I look at the Cloudflare marketplace: it has
apps for things such as cookie banners and automated GA integration, but
that's not that interesting.

What's the long-term vision for this?

~~~
rita3ko
I might misunderstand what you mean by third party service, but today you can
connect to any service on the Internet (including databases like Firestore)
with Workers using fetch() [1].

We're building out our storage products -- we started with Workers KV, our
distributed Key-Value store, and will to continue expanding our offering to
support more use cases. You won't be able to build everything with Workers
right away, but we've seen customers solve really interesting problems with
it. As we add functionality to support more and more use cases, we expect
Workers to grow into a really powerful platform.

Note that Cloudflare Workers is a different product from Cloudflare Apps
(which is what you see on the Marketplace). Cloudflare Apps does allow
developers who want to distribute their Worker to other Cloudflare customers
to do so, using Apps with Workers.

[1] More on fetch() here:
[https://workers.cloudflare.com/docs/reference/runtime/apis/f...](https://workers.cloudflare.com/docs/reference/runtime/apis/fetch/)

~~~
yeppie
> We're building out our storage products -- we started with Workers KV, our
> distributed Key-Value store, and will to continue expanding our offering to
> support more use cases.

I have no affiliation, but would love to see a partnership with Dgraph.. Feels
like a perfect match for both parties.

------
ksec
It seems all the CDN are having their own Edge WASM / Worker Engine out.
StackPath, Fastly, Cloudflare, and I am sure there are more to come.

But wouldn't very single one of these be a lock in that I cant really move
freely in and out, unlike CDN.

~~~
kentonv
Cloudflare Workers is based on the Service Workers API, which is a W3C
standard. StackPath looks like they are following this API too (though I
haven't dug into their docs). So it ought to be possible to move code between
these platforms. Hopefully others will follow suit as well.

Fastly has gone a different route since they support WASM exclusively (no
JavaScript), but I believe they are also following an open standard for the
underlying APIs (WASI).

(Disclosure: I'm the tech lead of Cloudflare Workers.)

~~~
Elof
I'm a developer evangelist for StackPath and can confirm that our serverless
product is also based on the Service Workers API

------
franciscop
I've been playing around with it for a project, and still need to experiment a
bit more but the KV store integration might just work nicely for sessions (no
strong consistency, but it seems to have it for the same session so ).

It has many usecases like validating a JWT, authorization for DB calls, cache
layer, transforming assets, scrapping, etc. Basically the usecases where you'd
normally launch a full server and be like "I need a full server for that?".

------
apple4ever
Workers is pretty cool. I've work with the Worker team and Queue-It to get the
later's SDK working there. Which has been wonderful to handle traffic at the
edge.

Two things I wish were better: package installation (you have to use a
compiled package instead of the GUI interface) and general docs (Mozilla's are
okay, but not all are applicable to Workers).

------
paulcarroty
Thinking a lot about serverless blog and seems this will be helpful.
Cloudflare makes many good projects last time.

~~~
steveklabnik
I’ll have a blog post next week (on my personal blog) that you’ll find
interesting! Workers + Workers KV is pretty great for this use case. KV isn’t
currently available on the free tier though; the $5/month plan should be more
than enough though. (I’m the PM of KV)

------
vizually
What are the limits of using Workers KV on different plans including the free
tier?

------
moooffooom
Is there something like that for python?

~~~
solotronics
StackPath EdgeEngine can do JS with WASM support for PHP, C, C++, Go, Python,
Perl, Rust + others
[https://www.stackpath.com/products/edgeengine/](https://www.stackpath.com/products/edgeengine/)

~~~
kentonv
Cloudflare Workers also supports Wasm and so supports all those languages,
too, in theory.

In practice, though, Python's, Perl's, and PHP's Wasm support is extremely
immature and probably won't meet the needs of a production web application
today. Go is closer but still presents challenges.

Rust seems to have by far the most mature Wasm tooling (and Rust support is
built-in to the Workers CLI tool). C and C++ are also reasonably usable.

------
cbHXBY1D
Any plans for C++ support?

~~~
steveklabnik
If you can compile your C++ to wasm, it will work. The tooling doesn’t support
it natively at the moment, so it’s not as simple, but it should work!

