Around 1,000 developers have expressed their views on edge functions, a modern approach to web applications, showing enthusiasm for performance and cost, but frustrations in areas including debugging and integration with third-party APIs.
The traditional way to deploy a web application is with hosted servers, load balancers, content delivery network for global low-latency to static content, and so on. Serverless functions, pioneered by AWS Lambda and also available via the likes of Azure Functions and Google Cloud Functions, can reduce or even replace reliance on hosted servers, but have issues like cold start, when a request has to trigger a new instance before it receives data. Provisioning and architecting applications that perform well everywhere is complex and expensive.
Edge functions are a more recent approach, where code is deployed to a provider which transparently distributes it on a global network. It is a natural fit with a content delivery network (CDN), which is why AWS Lambda@Edge is a feature of its CloudFront CDN. The barrier to entry for edge functions is low, and even a small low-traffic site can achieve global low-latency. Examples of edge function providers, aside from AWS, are Cloudflare, Fastly, Vercel, Netlify and Deno. Cloudflare and Fastly aside, these providers may use AWS, Cloudflare or other hyperscale clouds under the covers, which means customers in effect pay a markup; but that may be worth it if it abstracts the complexity, especially for small deployments.
The Deno-sponsored State of Edge survey attracted responses from a balanced spread of organizations ranging from solo developers (the biggest single group) to those with over 1,000 employees (65 of them). Although the absolute number of respondents is relatively small they claim to be an influential bunch, with 72 saying they are company founders, 60 architects or CTOs, 156 full stack engineers, and so on.
The first question is illuminating. Where are edge functions deployed? Cloudflare is the winner here, being top choice despite Deno’s sponsorship of the survey, followed by Fastly’s Compute@Edge. These providers may in principle offer the best value, as they deploy to their own networks, whereas the likes of Deno, Vercel and Netlify compete on developer experience.
What is the use case for edge functions? The top reason developers give is performance, followed closely by cost savings and ease of deployment. “True serverless, deploy everywhere at once around the globe, no OS updates, fast continuous deployment, easy to server render,” said one respondent.
There are challenges though. The biggest single problem, according to the survey, is “debugging behavior in live functions.” However well it is abstracted, this is distributed computing, and potentially complex to troubleshoot. “Distributed database synchronization” was mentioned by another respondent. “Actually developing the edge function” comes rather low in the list of top frustrations.