Skip to main content

Update by Brian Giori, lead engineer on our feature delivery system 

 

We’re excited to announce that local evaluation has been promoted to general availability! All Amplitude Experiment customers may now create local evaluation mode flags and experiments, or migrate existing flags to local.

 

What is local evaluation?

Server-side local evaluation runs evaluation logic on your server, saving you the overhead incurred by making a network request per user evaluation. The sub-millisecond evaluation is perfect for latency-minded systems which need to be performant at scale.

 

Performance

The primary benefit of local evaluation is its performance compared to remote evaluation. A single flag evaluation completes in well under a millisecond by avoiding having to make a network request per user evaluation. One local evaluation beta customer partner, especially affected by network latency caused by geographical distance, shaved over 100ms from their end-user latency, and nearly doubled server throughput during peak hours.

 

Tradeoffs

Because local evaluation happens outside of Amplitude, advanced targeting and identity resolution powered by Amplitude Analytics is not supported. That said, local evaluation allows you to perform consistent bucketing with target segments, which is sufficient in many cases.

 

Feature Remote Evaluation Local Evaluation
Consistent Bucketing ✅ ✅
Individual inclusions ✅ ✅
Targeting segments ✅ ✅
Amplitude ID resolution ✅ ❌
User enrichment ✅ ❌
Sticky bucketing ✅ ❌

 

 

 

SDKs

Local evaluation is only supported by server-side SDKs which have local evaluation implemented. Local evaluation for Ruby is in active development. Let us know if there’s a specific language you’d like support for!

 

SDK Remote Evaluation Local Evaluation
Node.js ✅ ✅
JVM (Beta) ✅ ✅
Go (Beta) ✅ ✅
Ruby (Beta) ✅ 🚧
Python (Beta) ✅ ❌


🚧 Ruby SDK is in active development for Local Evaluation

 

Advanced use cases

  • Edge-local evaluation
    • evaluation-js library can be used to run evaluation on edge compute platforms.
      • Works on AWS Lambda@Edge, Cloudflare Workers, and Akamai EdgeWorkers
    • Provides up-to-date variants for a user even if the content is served from the cache.
  • Server-side rendering
    • Node.js SDK is used to run evaluations when the page is rendered on the server.
    • Works with popular SSR frameworks (e.g. Next.js).
Be the first to reply!