Getting Started with Serverless Edge - Exploring the Options
There are a lot of options for serverless edge functions and services – and the list seems to get longer every day. It can be difficult to judge them too, because often you aren't comparing apples to apples. You might be comparing an offering that actually sits on top of another companies infrastructure with the offering from the infrastructure provider or even just a framework that makes it easy to deploy edge functions.
It can be confusing. In this post, I hope to help you get an overview of the various offerings and how they compare. There are a couple of caveats to get out of the way first:
- This is not a comprehensive list. I have tried to include the major offerings but I definitely have not included everything.
- This is not a ranking. I have not used all of these services, so I am not in a position to evaluate and rank all of them.
- I am looking at these services purely from the perspective of a web/front-end developer. Edge functions have uses beyond the web but that sits outside my own areas of expertise.
Check out my last post where I discussed the promise of edge serverless as well as potential use cases.
As I mentioned, part of the problem of evaluating edge serverless offerings is that you are often comparing two very different things that are labeled the same. To help clarify, I've created categories that I think best describe these offerings. They are:
These are the companies (mostly CDN companies) who have compute offerings like serverless edge functions, databases and more. While they have their own offerings, they also own the infrastructure upon which the other categories rely.
These include the following:
- Cloudflare Workers
- Deno Deploy
- AWS (Lambda@Edge, Cloudfront Functions)
- Fastly Compute@Edge
- Akamai EdgeWorkers
These are services that offer things like edge functions that are built on top of the core edge serverless offerings. The goal of these is usually to improve the developer experience of building edge serverless through continuous deployment while also integrating it with your broader projects, like adding edge functions into your web site codebase or your database.
Here are some examples of edge platforms with the core edge serverless offering they are built upon listed in parentheses.
- Netlify Edge Functions (Deno)
- Vercel Edge Functions (Cloudflare)
- Supabase Edge Functions (Deno)
- Cloudflare Pages Functions (Workers)
These are full-stack web frameworks that enable you to automatically deploy edge functions as part of your web application code.
- Astro (Example the Netlify SSR Integration)
- SvelteKit (See examples from Vercel and Netlify)
- Eleventy (Using the Eleventy Edge plugin that is Netlify only)
- Remix (Using adapters)
- Fresh (Built by Deno)
This is a relatively new category, but these are databases that replicate to the edge (note that I am not including data stores, though some of the prior core and platform offerings do offer a means of storing key/value or cached data at the edge). As I mentioned in the prior post, where your data lives is a core consideration when choosing to use an edge function.
- Fauna – A serverless database with built in global replication and strong consistency.
- Planetscale Portals (public beta) – A serverless MySQL database with support for replicating to read-only regions.
- Cloudflare D1 (still in private beta) – A SQLite based relational database that has globally replicated reads.
- DGraph – A distributed GraphQL database with a graph backend.
Of course, it depends.
If you are already tied to an existing CDN provider like Fastly, Akamai or Cloudflare for your existing infrastructure, then choosing their offerings may offer the easiest runway to get going. Edge platforms offer an easy option for those who have a greenfield project or are already deploying to these services and want an easy way to get started integrating edge functions while integrating them into new/existing web applications codebases.
If you are using an edge platform, you may also want to consider integrating an edge-enabled framework. This can greatly improve the developer experience of integrating edge functions into you web project.
In all cases, if your edge function(s) will be calling some form of data, you need to consider where that data will live. You don't want to move a function to the edge that relies on data that potentially comes from across the globe, thereby negating some/all of the benefit of moving to the edge. In some cases, an integrated K/V or cache will suffice, but if you need a full database, these services are worth exploring.
In the next post in this series, I will explore a few of the options that I listed a little bit deeper.