Getting Started

Architecture

How ConfigDirector delivers config values and updates

ConfigDirector Architecture

This section explains the high level architecture on how ConfigDirector evaluates config values and how it delivers updates to client and server SDKs.

For both, client and server SDKs, there are three connection mode options: streaming, polling and offline.

The streaming connection is the default behavior. In this connection mode, the client or server SDK opens a persistent HTTP connection to the ConfigDirector services. Upon connecting, it receives an initial payload with all the config values. From that point on, the server pushes any updates via Server Sent Events (SSE) whenever configs are updated. If the connection is dropped, the SDKs will automatically attempt to reconnect after 2 seconds, and apply an exponential backoff if failures continue.

In the case of the polling connection mode, the SDKs retrieve all the config values with an initial request. From that point on, they periodically poll the ConfigDirector services for additional updates. The polling interval is configurable, and every SDK enforces the same minimum, described in Polling intervals below. The use of polling is discouraged and should only be used in circumstances where a persistent streaming connection does not work within your system's constraints.

In the offline connection mode, an SDK never connects to the ConfigDirector services and sends nothing. It serves values your application gives it, inline or, on a server SDK, from a JSON file, to every context, so the application is invisible to the dashboard. It is meant for test runs that pin every flag to a known value. Every SDK can run this way; the Node.js SDK's Run without a connection section shows an example.

Polling intervals

Every SDK of the same kind shares one default polling interval and one minimum polling interval:

Kind of SDKDefault polling intervalMinimum polling interval
Client SDKs (JavaScript, React, Vue, Next.js client side, Nuxt client side, React Native, Flutter, Swift, Android, and their OpenFeature providers)60 seconds30 seconds
Server SDKs (Node.js, Next.js server side, Nuxt server side, Python, Java, .NET, Go, and their OpenFeature providers)300 seconds (5 minutes)60 seconds

The rule is enforced identically in every SDK: when the connection mode is polling and the configured interval is below the minimum, the SDK polls at the minimum instead and logs a single warning when the client is created. No SDK rejects a low interval and there is no maximum. In streaming mode the polling interval has no effect.

Each SDK page documents the name and unit of its polling interval option.

Architecture of client SDKs

Your client or mobile application makes use of one of ConfigDirector's client SDKs to communicate with ConfigDirector's services that evaluate configs.

The high level view is as follows:

Client SDK architectureThe client SDK in your application connects to the ConfigDirector SDK service and provides the context. The service evaluates the configs' targeting rules for that context and pushes updated values to the client SDK over server-sent events.Your Client/Mobile ApplicationConfigDirector SDK ServiceConnects and provides the contextPushes updates via SSEConfigDirector Client SDKClient SDK APIEvaluates configs' targeting rulesfor the given context
  1. The ConfigDirector client SDK opens a connection to the ConfigDirector SDK service. It provides the context, if one was given.
  2. The ConfigDirector SDK service evaluates all of the configs' targeting rules using the context provided, and returns the configs with their evaluated values
  3. The client SDK stores the payload it received from the SDK service and returns the appropriate values whenever a config value is requested by the application
  4. The client SDK and SDK service keep the connection open. Whenever configs or segments are updated (via the dashboard or Admin API) the SDK service pushes events to the client SDK with the updated config values.

If the application updates the context via the client SDK, the process restarts from step (1) above. A new connection is initiated with the updated context.

If a config value is requested from the client SDK before it receives the initial payload from the SDK service, the client SDK returns the values the SDK service last sent it, which it keeps on the device, as long as they were evaluated for the same context. An application opened without a network, after at least one successful connection, therefore serves those values instead of the in-code default values, with the evaluation reason cached. On the first launch, or when the application starts with another context, the client SDK returns the in-code default value until the initial payload arrives. From then on it returns the values of the latest payload it received, and keeps them on the device in place of the earlier ones. The Values kept on the device section of each browser and mobile SDK page shows how to turn this off or use your own store.

Architecture of server SDKs

Your server application makes use of on of ConfigDirector's server SDKs to communicate with ConfigDirector's services. In the case of server SDKs, evaluation is done by the SDK rather than the remote service.

The high level view is as follows:

Server SDK architectureThe server SDK in your application connects to the ConfigDirector SDK service, which returns configs, targeting rules and segments without evaluating them and pushes updates over server-sent events. The server SDK evaluates the targeting rules for each context.Your Server ApplicationConfigDirector SDK ServiceConnectsPushes updates via SSEConfigDirector Server SDKEvaluates configs' targeting rulesfor the given contextServer SDK APIReturns configs, rules and segmentswithout evaluating them
  1. The ConfigDirector server SDK opens a connection to the ConfigDirector SDK service
  2. The SDK service returns all the configs, their targeting rules, and the segments those rules use, without evaluating them
  3. The server SDK stores the payload in memory
  4. When your application requests a config to be evaluated for a given context, the server SDK uses the in memory config definitions and targeting rules to evaluate the given config value
  5. The server SDK and the SDK service keep the connection open. Whenever configs or segments are updated (via the dashboard or Admin API) the SDK service pushes events with the updated configs, targeting rules, and segments.
In the event that a config value is requested from the server SDK before it receives the initial payload from the SDK service, the server SDK will return the default value provided in code. Once it receives an initial payload, from that point on it will evaluate configs with the definitions and targeting rules it has cached in memory until new updates are received from the SDK service.