Cloudflare Workers, serverless on edge - 1

·

3 min read

While discussing my love for WebAssembly with a friend recently, he told me that I must enjoy Cloudflare Workers, as it is based on this technology. I then felt stupid for knowing its existence (I read the description page once), but never testing it.

This article is my first take on Cloudflare Workers. What they are, and what makes them different from the solutions of other Cloud Providers.

Cloudflare

Before diving into Workers, let's talk a bit about Cloudflare. In the developer community, Cloudflare is mainly known for its Content Delivery Network (CDN) which exists (almost) since its debut in 2010. For the rest of the world, it is also known for its web security solutions, notably DDoS mitigation.

These solutions make for a very wide network, with a lot of Points-of-Presence (PoP) around the world (see their website). As each PoP requires both processing power and storage to deliver these security solutions and user content (CDN) they, in turn, are a good basis for other serverless usage.

I am not a representative of Cloudflare. Check their website if you want more information on the different solutions they provide. 😉

Iaas, PaaS, SaaS… which is it?

If you take a look at the services provided by the main Cloud Providers (AWS & co), they span a wide range, from the infrastructure (even bare-metal servers) to software solutions (the Office suites for instance), trying to accommodate every possible aspect of a customer Information System (IS).

While making sense if you want your fingers in every part of your customer's IS, providing all these services requires a lot of maintenance on the diverse infrastructures and software.

on-site vs IaaS vs PaaS vs SaaS

(image from RedHat article on the topic, as a reminder)

Cloudflare took a different approach: they only provide PaaS services (be it for the network, the computing or the storage). Note that it is not unique to Cloudflare, other companies like Clever Cloud (which is a French company, cocorico) also focus on PaaS solutions.

On to Cloudflare Workers!

Finally getting to the point… 😮‍💨
In 2017, while previously centered around web security and content delivery, Cloudflare announced "Workers", a serverless computing solution. As teased above, of course, this is a PaaS solution.

The workload (aka your application) runs directly on their different PoP across the globe, as close to each user as possible, reducing the network latency. This was only made possible by two things:

  • their wide network previously mentioned, each PoP becoming a computing unit,

  • WebAssembly, allowing for fast and strongly isolated deployments, in whatever programming language supporting it.

Outro

While this article was a (way too long) introduction to Cloudflare Workers, in the next one we will focus a bit more on how to use them and the other serverless services revolving around (in particular for storage).