Cloudflare announces first beta version of workerdwhich is a JavaScript/Wasm runtime; based on the same code as Cloudflare Workers and open sourced under the Apache-2.0 license.Cloudflare Workers is a serverless platform that runs on the company’s content delivery network and is designed to provide low latency to users in any region.

According to Kenton Varda, technical lead at Cloudflare Workers,workerd shares most of the code with the runtime that supports Cloudflare Workers, with some changes to make it easier to port to other environments. The name “workerd” comes from the Unix naming server tradition, using the “-d” suffix for “daemon”. The name is not capitalized because it is a program name, following the lowercase tradition in Unix-like environments.

While it shares code with Cloudflare Workers, Varda noted that a full Cloudflare Workers service involves many technologies outside of workerd itself, including additional security, deployment mechanisms, orchestration, and more. “workerd itself is part of our runtime codebase, which itself is a small (albeit critical) part of the overall Cloudflare Workers service. But we’re happy that it means we can release this code under a permissive open source license “.

According to the introduction, through workerd, developers writing code for Cloudflare Workers can run code locally, or on self-hosting, or on other services, reducing the risk of being locked out.workerd is designed to facilitate actual local testing of Workers; andCanas a web server,Act as an application host, proxy, or both, and it supports forward and reverse proxy modes.

Varda noted, “Where possible, Workers (especially workerd) provide the same standard APIs as in web browsers, such as Fetch, URL, WebCrypto, etc.This means that code built on workerd is more likely to be ported to browsers and other standards-based runtimes“.

In addition, workerd alsois a nanoservice runtime.Nanoservices is a new model that achieves the benefits of independent deployment with an overhead closer to that of a library call. Using workerd, many workers can be configured to run in the same process. Each Worker runs in a separate “isolate”, giving the impression of being independent of the others: each isolate loads separate code and has its own global scope. However, when one worker explicitly sends a request to another worker, the target worker actually runs in the same thread with zero latency. So it’s more like a function call.

However, some foreign media pointed out that although this design is friendly to performance, it will affect security. workerd workers are designed to be inaccessibleresources for which access has not been grantedbut it is not secure against bugs or vulnerabilities in workerd itself or in the V8 engine, so additional security is required.Varda alsoSaid that the security part of Cloudflare Workers is not included in the open source version.

One of the main benefits of workerd, he added, is that “it allows for a new development model where you can split applications into smaller components. It’s also easier to deploy code on Workers than managing servers on traditional cloud providers. much”.

As for why JavaScript/Wasm over other languages ​​like Java, .NET or Python.Varda explained, “Containers are too heavy to support the nanoservices model…JavaScript and Wasm are our only viable lighter-weight options for our isolation needs.Virtual machines in other languages ​​are generally not designed for this fine-grained isolation use case, nor are they battle-tested“.

Varda is still at Hacker News Answered some questions from netizens, and some developers gave feedback workerd relatedPositive reviews.

More details can be found on the official blog.

#Cloudflare #Introduces #Workerd #Open #Source #JavaScriptWasm #Runtime

Leave a Comment

Your email address will not be published. Required fields are marked *