Local evaluation runs evaluation logic in the SDK, 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.
Local evaluation happens outside of Amplitude, which means advanced targeting and identity resolution powered by Amplitude Analytics isn't supported. That said, local evaluation allows you to perform consistent bucketing with target segments, which is often enough.
Client-side local evaluation data sensitivity
When using client-side local evaluation it is important to note that all data used in targeting is included in the flag configuration loaded on the client-side. For example, if you are targeting a specific user by their email, that email has effectively been leaked to all clients, regardless of user.
|Amplitude ID resolution
The SDK loads flag configuration updates from the server on startup and stores them in memory for access prior to each evaluation. After startup, the SDK begins polling for flag configuration updates from the server.
Exposure and assignment tracking¶
Local evaluation SDKs track evaluations differently on the client-side vs on the server-side.
- Client-side SDKs track an exposure event when the user is evaluated due to a variant being accessed from the SDK.
- Server-side SDKs track an assignment event (if configured to do so) when a user is evaluated.
Server-side local evaluation experiments often set the Assignment event as a heuristic for Exposure.
All server-side SDKs and all client-side (which have local evaluation enabled) support local evaluation.
The following results are for a single flag evaluation, and were collected over 10 executions of 10,000 iterations of evaluation with randomized user inputs evaluated for 1 flag configuration, selected at random out of 3 possible flag configurations.