In 2014, AWS introduced Lambda, freed us up from the need to manage servers, and ushered in the serverless revolution. Other cloud vendors providers soon joined the fray, with their own Function as a Service (FAAS) platform. 3 years back, in Sep 2017, Cloudflare released their serverless execution environment called Workers.

Cloudflare Workers is a service that allows you to execute code, such as JavaScript, on the edge using Cloudflare's global content delivery network (CDN), instead of in a single datacenter. There are several innovations which make Cloudflare Workers a compelling proposition, as compared to traditional cloud vendors:

  • Isolates: Cloudflare innovatively uses Chrome’s V8 Isolates and a server-side implementation of the Service Worker API. Additionally, workers run on standard JavaScript or any other languages which can compile to Web Assembly.
  • Edge execution - Cloudflare workers execute on their edge network, between your servers and your users' devices. It is like running Chrome, except instead of running it on your laptop or mobile device, it runs on Cloudflare's edge network. The Cloudflare network spans over 200 cities in more than 100 countries. Their 25 Tpbs network capacity is 15x bigger than the largest DDoS attack ever recorded. The Cloudflare global footprint puts these serverless functions within 100ms of 99% of the developed world (and 95% of the entire world’s population).
  • Zero millisecond cold starts: Serverless offerings are notoriously plagued with a lag in the response times for an inactive function (aka cold start). This lag happens primarily due to a slight delay when provisioning the function on a container. Because of its use of isolates, Cloudflare Workers already had very low cold start times of 5 ms, to begin with. However, recent smart TLS handshake optimizations by Cloudflare have reduced worker cold starts to 0.
  • Very affordable: The first 100,000 daily requests are free. The paid plan starts at a measly monthly $5 for 10 million requests, and then $0.5 per million requests thereafter. Cloudflare Workers are one of the cheapest FAAS solutions out there.

Cloudflare Network Map

Cloudflare has been rapidly building out additional services to support its Worker platform, such as

  • Workers Unlimited: Unlimited execution times instead of the up to 50 ms restrictions for each worker.
  • Workers KV: An eventually consistent, global, low-latency, key-value edge data store, suitable for read-heavy, write-light workloads
  • Durable Objects: Durable Objects makes it possible to build strongly consistent serverless stateful services entirely on the edge

Your web applications - both interfaces and APIs can get deployed to hundreds of data centers around the world, returning responses to your users from locations closest to them. All of this faster and cheaper than your VM hosted server ever could. Connect with us to determine if you can effectively leverage Cloudflare workers for your business.