Performance

What You Need to Know About the Serverless Edge

September 5, 2023 11:00 AM
Long Lecture
🇬🇧 English
CMYK

About

If you listen to the hype, everything is moving to the "edge!" First we started deploying our apps and assets there and now our functions are moving there and even our data is migrating there. If you're wondering how the edge applies to you and your app, this session will break it down. We'll cover what we mean by the edge, whether the edge lives up to its lofty promises and ways you can get started using edge functions and edge data to improve your application.

Watch the full talk

Watch this WaysConf session, then continue with related talks or explore the current programme.

From the recording

Talk in brief

In this WaysConf 2023 session, Brian Rinaldi from LaunchDarkly explores the practical realities, capabilities, and constraints of serverless edge computing. While edge architectures promise reduced latency by bringing compute closer to users, Rinaldi warns that querying centralized, region-locked databases from global edge nodes can introduce unexpected round-trip delays. He demonstrates how intercepting HTTP requests and responses at the edge enables powerful capabilities such as server-side personalization, A/B testing, localized redirects, and security checks without client-side rendering flashes. Rinaldi breaks down the current edge landscape across core CDN providers like Cloudflare and Deno Deploy, platforms like Netlify and Vercel, and emerging edge database solutions that utilize centralized writes with distributed read replicas. Finally, he outlines technical trade-offs, emphasizing that strict memory limits, shorter execution timeouts, and non-Node.js runtimes require deliberate architectural choices.

Key takeaways

  1. 01

    Latency Benefits Require Edge Data Strategies

    Moving compute to CDN nodes reduces network distance, but querying a single region-locked database still creates significant latency. Edge computing achieves its performance potential only when data reads are localized or cached alongside the compute layer.

    Watch from 6:26
  2. 02

    Request Interception Unlocks Dynamic Features

    Edge middleware can intercept and alter HTTP requests and responses before reaching the origin server. This allows developers to deliver A/B testing, user authentication, and dynamic HTML personalization without client-side rendering flashes.

    Watch from 9:15
  3. 03

    Strict Execution Limits Constrain Edge Compute

    Edge functions face tighter constraints on execution time, available memory, payload size, and response windows than standard serverless functions. These runtime limits ensure quick execution and prevent middleware from slowing down page delivery.

    Watch from 16:22
  4. 04

    Edge Databases Rely on Eventual Consistency

    Modern edge database architectures deploy read-only replicas globally while routing write operations back to a primary central server. Developers must account for replication delay, as global state updates can take several seconds to synchronize across all nodes.

    Watch from 21:29
  5. 05

    AWS Splits Edge Functions Across Two Models

    Amazon Web Services separates edge functionality into full-featured Lambda@Edge functions across regional caches and lightweight CloudFront Functions across hundreds of edge locations. Choosing between them depends on whether an application requires complex code execution or basic header manipulations.

    Watch from 32:34
Read edited transcript highlights

These concise notes were edited from automatic captions and checked against the talk structure. They are not a verbatim transcript.

Realities of Latency and Centralized Databases

Deploying functions to the edge brings compute closer to global users, but performance gains quickly evaporate if the underlying database remains locked in a single cloud region. When an edge function running in Japan must query a database hosted in the eastern United States, the physical distance introduces latency that negates the benefits of localized execution. In worst-case scenarios, making sequential API calls across multiple regions from an edge function can actually increase response times compared to running the entire backend within a single origin region. To truly reduce latency, developers must pair edge compute with localized data access strategies.

Watch from 6:26

Modifying Requests and Personalizing HTML Responses

One of the most valuable capabilities of serverless edge functions is their ability to intercept incoming requests and outgoing responses. Edge middleware can inspect incoming user traffic to perform authentication redirects or geographic routing before reaching the origin server. On the return path, edge workers can rewrite HTML on the fly to inject dynamic features, user personalization, or compliance elements like cookie notices into statically cached pages. This hybrid approach delivers the performance speed of static asset hosting while maintaining the flexibility of full server-side rendering.

Watch from 9:15

Overcoming A/B Testing Challenges at the Edge

Traditional A/B testing methods force developers to choose between client-side JavaScript manipulation and server-side decision making. Client-side scripts often cause a noticeable layout shift or flash of unstyled content as variations render after page load, while server-side solutions can interfere with CDN caching layers and slow down response times. By moving experiment logic to edge functions, applications can evaluate feature flags and modify page content at the network boundary. Users receive fully rendered, variation-specific HTML without layout shifts, preserving both user experience and caching efficiency.

Watch from 12:01

Runtime Limits and Resource Restrictions

Edge functions operate under significantly tighter operational constraints than conventional serverless compute environments like AWS Lambda. Providers enforce strict caps on bundle sizes, available RAM, overall execution time, and response timeouts to ensure middleware executes in milliseconds. Because these runtimes prioritize minimal cold start times over heavy processing, developers cannot simply migrate entire monolithic applications to the edge. Instead, edge compute should be reserved for high-speed routing, light data transformations, and immediate response delivery.

Watch from 16:22

Navigating Diverse Provider Implementations

The edge ecosystem spans CDN-based infrastructure like Cloudflare Workers and Deno Deploy, platform wrappers such as Netlify and Vercel, and framework-level integrations in Next.js and Remix. Each provider relies on distinct runtimes rather than standard Node.js environments, requiring developers to learn specific APIs and adapt npm dependencies accordingly. Furthermore, platform abstractions simplify deployment workflows but may omit certain underlying features, such as specific key-value stores or global region coverage. Choosing the right stack requires evaluating runtime compatibility, data requirements, and deployment tooling.

Watch from 17:46

Architecture of Edge Database Replicas

To support global compute layers, modern database providers offer edge-compatible storage solutions. These systems typically maintain a single primary database for write operations while distributing read-only replicas across multiple global regions. While this model allows localized edge functions to execute ultra-fast database reads, it introduces eventual consistency. Updates written to the central primary database take time to propagate across all edge nodes worldwide. Developers building edge applications must account for replication lag, which can take several seconds depending on the underlying network and provider infrastructure.

Watch from 21:29
Explore WaysConf 2026