This topic explains how data saving mode works in the LaunchDarkly SDKs that support it, listed below. The Relay Proxy also supports data saving mode.
Server-side SDKs in data saving mode first open a polling connection to LaunchDarkly. The initial payload from this connection contains the data the SDK will need to operate and perform flag evaluations.
Subsequently, server-side SDKs in data saving mode open a streaming connection and receive realtime flag configuration changes over the stream. These configuration changes include only the difference between the server-side SDK’s stored configuration and the latest configuration in LaunchDarkly. The SDKs use in-memory data for the unchanged aspects of the flag configuration.
The SDKs fall back to using a polling connection if LaunchDarkly streaming is unavailable. Data saving mode includes additional configuration options that let you set a backup data source, enabling automatic failover if a connection is unavailable.
Depending on the number of flags in your project and the complexity of their configuration, data saving mode can significantly improve performance, including reducing your network costs when in polling mode or on reconnection. Additionally, SDKs in data saving mode have reduced memory and CPU usage overall.
When using data saving mode, you can track which applications are consuming service connections by configuring application metadata. Set the applicationId in your SDK configuration to see a per-application breakdown on the Service connections usage page under the SDK App ID dimension. Server-side streaming connections without applicationId configured appear as “Unknown.” To learn how, read Application metadata configuration.
This feature is available in the following SDKs:
To enable data saving mode:
DataSystem configuration option.Here’s how to enable the DataSystem configuration option:
We recommend the standard data system configuration for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read DataSystemModes for information about pre-configured data system modes, and DataSystemBuilder for information on additional configuration options.
To enable data saving mode:
DataSystem configuration option.Here’s how to enable the DataSystem configuration option:
We recommend the standard data system configuration for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read DataSystem. For information on additional configuration options, read DataSystemConfiguration.
To enable data saving mode:
dataSystem configuration option.Here’s how to enable the dataSystem configuration option:
We recommend the default data system configuration for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read DataSystemModesfor information about pre-configured data system modes, and DataSystemBuilder for information on additional configuration options.
To enable data saving mode:
dataSystem configuration option.LDOptions fields. The following existing options were previously top-level LDOptions fields and are part of the dataSystem configuration as of version 9.10: persistentStore, stream, streamInitialReconnectDelay, pollInterval, useLDD.Here’s how to enable the dataSystem configuration option:
We recommend the standard data source option for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read dataSystem. For information on additional configuration options, read LDDataSystemOptions.
To enable data saving mode:
DataSystem configuration option.Here’s how to enable the DataSystem configuration option:
We recommend the standard data system configuration for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read ldclient.datasystem. For information on additional configuration options, read DataSystemConfig.
To enable data saving mode:
data_system_config configuration option.Here’s how to enable the data_system_config configuration option:
We recommend the standard data system configuration for most customers. It uses a combination of streaming and polling to initialize the SDK, provide real time updates, and switch between streaming and polling automatically to provide redundancy.
To learn more, read LaunchDarkly::DataSystem. To learn more about additional configuration options, read DataSystem::ConfigBuilder.