HappyKit

All posts

Announcements

Announcing the Vercel Integration

Fast feature flags with Edge Config

Today I’m extremely proud to announce the brand new HappyKit Integration for Vercel.

Just a few minutes ago Vercel announced the Public Beta of their new Edge Config product. An Edge Config allows you to store data globally, right next to your deployments. This data can then be read by your project at ultra low latency - without making network requests.

HappyKit’s Vercel Integration lets you store your feature flag definitions in Edge Config, which allows you to read your feature flags without increasing your site’s load time.

How the integration works

Every time you change your feature flags on HappyKit the integration will store the updated flags in Vercel’s Edge Config. You can then configure @happykit/flags in your application to read your latest feature flag definitions from Edge Config instead of loading them from HappyKit itself.

This means your application can fully evaluate feature flags without ever sending a network request.

This of course results in unbeatable latency.

Let’s talk some actual numbers

If your project is hosted on Vercel, this integration allows you to use feature flags at ultra low latency. And when I write that, I truly mean it. Let’s talk some actual numbers.

These numbers were measured on a project receiving 2 million monthly views from all over the globe:

  • p25 of 0ms - 25% of requests read flags in under zero milliseconds
  • p50 of 5ms
  • p90 of 9ms
  • p99 of 14ms

The latency shows how long it takes the application to read feature flags from a Next.js Middleware. Reading feature flags from middleware allows you to dynamically decide which variant of a page a given user should see, and to then route between two static variants of a page. This means you can do A/B Testing without introducing Layout Shift, while barely affecting your TTFB.

If you are reading your feature flags during Server-Side Rendering I have even better news for you. Edge Config can be read in 1ms p99 when accessed via getServerSideProps, React Server Components or API Routes.

What makes it so fast?

Vercel’s Edge Configs are colocated with your deployments. They are available globally, just like your application deployed on Vercel. In fact, your application hosted on Vercel can read Edge Config without making network requests. But changing your Edge Configs does not require a new deployment. So the changes propagate worldwide in seconds - instead of having to wait for a full build. This is a perfect fit for HappyKit’s Feature Flags.

How can I get started?

You can install the HappyKit integration onto your Vercel projects here:

https://vercel.com/integrations/happykit

If you’re already a HappyKit user, we prepared an example pull-request here which shows how to upgrade your application to benefit from this integration.

© 2024 HappyKit. All rights reserved.