Service Resiliency

How we keep your product working even if the Reflag service is disrupted.

To keep your product working even if the Reflag service is disrupted, we provide a number of safe guards and features that build resiliency.

Local evaluation

To improve latency and provide downtime protection, our node-sdk and openfeature-node-sdk perform "local evaluation" of flag rules.

With local evaluation, our SDKs will download the flag definitions from our servers and check the user and company properties against the flag rules in your application instead of contacting our servers for every evaluation. The SDK caches the downloaded list in memory, so will keep working during service disruption so long as the service that is using the SDK doesn't get rebooted.

Edge-runtime (like Cloudflare Workers) support

Equally as effective as local evaluation is our support for edge-runtimes like Cloudflare Workers, also in the Node SDK.

Reflag maintains a cached set of flag definitions in the memory to decide which features to turn on for which users/companies.

The EdgeClient uses a strategy to keep these feature definitions fresh: The first request to a new worker instance fetches definitions from Reflag's servers, while subsequent requests use the cache. During an invocation, when the cache has expired, the request will be served using the stale cache while it’s being updated in the background, so response times are not affected. However, during downtime, this cache would continue to be served.

Bootstrapped flags

With getFlagsForBootstrap()arrow-up-right in the Node SDK and ReflagBootstrappedProviderarrow-up-right in the React/Vue SDKs, you can evaluate flags on the server and pass them to your client-side applications.

Bootstrapping is recommended as it means that the server has local evaluation and will pass the evaluated flags to the frontend on load, further protecting you from service disruption.

Offline flags

We also provide Offline Modearrow-up-right in all our SDKs, which, when enabled, means we use flag overridesarrow-up-right. This is generally useful during testing and local development; however, it can also be supplied to the SDKs so that they are used as defaults if our servers are down.

Client SDK caching

Finally, all client SDKs cache the last known flags and will keep using those in case the browser cannot reach our server.

Last updated

Was this helpful?