Live data from Hacker News

Cloudflare Workers: Run JavaScript Service Workers at the Edge

blog.cloudflare.com

101–110 of 134 posts

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#101

I read the article, but I'm not sure what this technology is enabling really. Can it be thought of as a new player in the lambda/serverless category? Does it have any advantages to using other serverless stacks like aws lambda or azure?

The advantage is that the code runs close to your users. 90% of the people on Earth are within 10ms of a Cloudflare location, so by pushing your code out to the edge you can make your site faster. You also save on the cost of transmitting data around the world.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#102

Sounds like this could be a pretty trivial way to load balance React prerendering. As long as the react code fetches all data in 1 call it should be at least as efficient as doing it all in Nodejs on your server.

Relevant example using Preact https://cloudflareworkers.com/#87ec550da87ab3f7de756a4979c00...

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#104
post #39
post #36

Earlier quoted context omitted.

Can I use this together with CloudFlare streaming to open up stream ingestion based on some HMAC signed parameters? To give regular end-user the rights to e.g. 'record one video of up to X seconds and Y mbps under ID "some-uuid"' I've been waiting for a proper Content Ingestion Network for ages by now... if the CloudFlare video team ever wants to talk to someone who hand-rolled their own single-node version of this I…

That's a really interesting idea!

If you added this with RTMP+WebRTC ingestion support all of these [1] companies would probably jump on the opportunity... and dozens more would start up in that space ;-)

[1] http://interviewingsoftware.com/

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#106
This sounds like a really powerful feature. I love how it uses JavaScript, which makes it much more approachable for web developers.

My experience with Service Worker APIs hasn't been very positive, although I don't have any suggestions for ways it could be improved, so I apologize for the non-constructive feedback. Maybe after using it more I'll change my mind. I recognize that everyone involved is likely working hard to provide an API that's capable of handling a wide range of problems, many of which I likely haven't even considered.

Here's a more actionable complaint: fetch doesn't support timeout or abortion. I have a hard time understanding how this isn't a problem for more people. Say what you will about XMLHttpRequest, at least it supports these basic features. As an end-user, I always find it absolutely infuriating when things hang forever because a developer forgot to handle failure cases.

I'd love it if you published a locally runnable version. Aside from making it easier to configure and experiment, it would give me peace of mind to know that I could continue to use the same configuration if Cloudflare decided to terminate my service.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#107

This sounds like a really powerful feature. I love how it uses JavaScript, which makes it much more approachable for web developers. My experience with Service Worker APIs hasn't been very positive, although I don't have any suggestions for ways it could be improved, so I apologize for the non-constructive feedback. Maybe after using it more I'll change my mind. I recognize that everyone involved is likely working ha…

Abortable fetch actually just recently became a thing, as in the Github issue was closed 9 days ago. More info:

https://developers.google.com/web/updates/2017/09/abortable-...

We'll be implementing soon.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#108
post #49

Earlier quoted context omitted.

> There is a theoretical solution that we might be able to explore at some point: If compute is deterministic -- that is, always guaranteed to produce the same result given the same input -- then it can't possibly pick up side channels. Doesn't this require the timing and interleaving with other processes also be deterministic? ...which seems hard to guarantee with modern CPUs, async IO, and shared execution.

If you don't provide (real) time as an input to the program, then non-determinism of time does not affect determinism of the program. At least, in theory. It's definitely a long way from there to practice.

That's true -- but "the program" is also any code using yours as a middle-step, which is the case of a network service is a huge number of people. So anything that requires total program control rather than subroutine enforced safety is a nonstarter.

The timing may occur outside of your control, and then statistical profiling used. If the timing of a reponse to a network request has a time component that depends on shared load, then you have a side-channel.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#109
post #13

Earlier quoted context omitted.

Will there be any limits on memory/execution time etc like with AWS Lambda?

Yes. Currently you get at most 50ms CPU time per request, and memory usage of your Javascript VM is limited to 128MB. These numbers may change before launch. In practice, though, a typical script probably uses much less than 1ms of CPU time per request and probably needs only a couple megs of RAM. Because we're applying limits on the level of a V8 Isolate, not on an OS process, the limits go a lot further. Keep in mi…

I would very much like to see a pay-as-you-go cloud pricing model that allows you to pay to go over these limits (within reason.) For the use case I'm envisaging, filtering largish buffers of Cap'N Proto data (I'm tickled that both of these things are your babies!) I can use streaming fetch API to stay within the memory limit, but the 50ms limit would really be a hard wall that would cause requests to fail on larger amounts of data. I'd be happy to pay in those cases for extra execution time.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#110
Great addition to your services. I really want to see the pricing. Also I'm quite excited to see how this will play along with the apps concept. Do you plan also to introduce a monetisation system for the apps? It will be a good incentive then for developers to get some nice income.
Post reply on HN