Local evaluation resolves feature flags on the client or server without making a network call to a central service at evaluation time. The flag configuration is downloaded once and cached in-process, and every subsequent flag evaluation runs locally against that cached configuration. The result: flag resolution in 10 to 50 microseconds, with zero dependency on network availability.
This is the opposite of remote evaluation, where every flag check sends a request to a cloud service and waits for the response. Remote evaluation adds network latency (typically 20-100ms) to every flag check and creates an availability dependency: if the flag service is down, your flag evaluations fail.
How does local evaluation work?
The process has two phases.
Configuration sync. The SDK downloads the full flag configuration (all flags, rules, targeting conditions, and variant payloads) from the flag management service. It stores this configuration in memory. The SDK periodically polls for updates or receives them through a push channel, keeping the local copy current.
In-process evaluation. When your code calls getVariant("flag-key", context), the SDK evaluates the flag rules against the provided context entirely in local memory. It checks targeting conditions, computes the bucket hash for deterministic assignment, and returns the variant. No network call. No external dependency.
Confidence's local evaluation mode works exactly this way. The flag configuration syncs to the SDK, and all evaluations happen in-process. A Confidence outage doesn't affect your flag evaluations because nothing about the evaluation path depends on Confidence being reachable.
When should you use local evaluation?
Latency-sensitive paths. If flags are evaluated on every API request, every page render, or every ML inference call, adding 50ms of network latency per evaluation is unacceptable. Local evaluation adds microseconds.
High-throughput services. A backend service handling 100,000 requests per second can't send 100,000 flag evaluation requests to an external service. Local evaluation handles this with in-memory lookups that scale with CPU, not network bandwidth.
Resilience requirements. Any system where flag evaluation failure means degraded user experience benefits from local evaluation. The cached configuration keeps working even if the management service is temporarily unreachable. This is especially important for mobile apps, where network conditions are unpredictable.
At Spotify, where 300+ teams run experiments across 750 million users, local evaluation isn't optional. The volume of flag evaluations across all Spotify clients and services would be impractical to serve through a centralized remote service. Confidence's local evaluation mode was built for this scale.
What are the trade-offs?
Local evaluation means the SDK has a copy of the entire flag configuration, or at least all flags relevant to the current service. This has two implications.
Update latency. When you change a flag in the management UI, the change doesn't take effect until the SDK's next sync cycle. Depending on the polling interval, this can be seconds to minutes. For most flag changes, this delay is acceptable. For emergency kill switches, a shorter sync interval or push-based updates can reduce the gap.
Configuration size. If you have thousands of flags, the full configuration payload can be large. In practice, SDKs are scoped to the flags relevant to a specific service or application, keeping the payload manageable.
Secret exposure. Server-side SDKs can safely cache the full configuration because the flag rules stay within your infrastructure. Client-side SDKs (mobile, browser) need to be more careful: you don't want to expose unreleased feature names or internal targeting rules to end users. Confidence handles this by resolving only the specific flags the client requests, without exposing the full rule set.
How does local evaluation relate to edge resolvers?
Both local and edge evaluation eliminate the round-trip to a central flag service, but they work at different points in the architecture. Local evaluation runs inside your application process. Edge evaluation runs at the CDN or edge compute layer, before the request even reaches your origin server. They're complementary: use local evaluation for server-side flags in your backend, and edge evaluation for flags that need to resolve at the network boundary.
Confidence offers cloud, local, and edge evaluation as three resolution modes, each optimized for different latency and resilience trade-offs.