The problem is that node is not a good cgi engine.
The problem is that node is not a good cgi engine.
Cloudflare Workers and KV @ the Edge can do a lot to manage the control plane.
Using Python for Workers was weird, and it felt like you needed to be both a Python and JS expert to make it work.
Since node is so dominant for serverside js, fastcgi with javascript is very uncommon.
PS: I do not know whether deno is better for fastcgi, but it is unlikely that it would be good enough.
Also I am not an expert so I will not be able to prove anything, but I can try my best to express my opinions.
I do not think that node has any problems with FastCGI
So basically Node's start latency are too slow for CGI and FastCGI is bad for a worker platforms (or for any multitenant offering).
The reason is that cloudflare doesn't want to keep track which workers are for which customers and want to offer a clean slate environment for each request.
This either means spinning up new processes or using some other in-process isolation techniques. All javascript workers platforms I know use V8 isolates, which (I believe) node does not offer.
PS: I made also another mistake, it looks like deno offers a worker platform on V8 isolates. https://deno.com/deploy
So, in order to host Node apps on behalf of multiple customers, you must run multiple copies of Node.js as separate processes, and you must use some sort of secure containerization or VMs to isolate them from each other and from the system.
That in turn means there's a lot of overhead involved in running each application instance. To amortize that overhead, it's necessary for each instance to handle a large number of events, so that the per-event overhead is reasonable. So, you need to concentrate your traffic stream onto a small number of instances.
Workers, however, had the design goal that every application would run at every one of Cloudflare's hundreds of locations, in order to run as close to the end user as possible. That implies that there may be hundreds of instances of an app around the world, while each instance only handles traffic from a particular locality, which may be small. This means the setup overhead per instance had to be much less, and it had to be possible to run tens of thousands of live instances per machine, with the ability to quickly load from a library of millions on disk on-demand.
That's just not possible with containers, or even processes. But it is possible if you run lightweight V8 JavaScript instances -- called "isolates" -- all inside a single process.
This talk of mine goes into a lot more detail: https://www.infoq.com/presentations/cloudflare-v8/
(I'm the lead engineer for Workers.)