Data saving mode
Data saving mode is available for Early Access
Data saving mode is supported in the Go and Node.js (server-side) SDKs. It is also supported in the Relay Proxy.
Data saving mode is only available to members of LaunchDarkly’s Early Access Program (EAP). If you want access to this feature, join the EAP.
Overview
This topic explains how data saving mode works in the LaunchDarkly SDKs that support it.
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.
Server-side SDKs
This feature is available in the following SDKs:
Go
Expand Go SDK code sample
To enable data saving mode:
- If you are using the Relay Proxy, upgrade your Relay Proxy to version 9.0.0-alpha.1 or later.
Relay Proxy version 9 supports data saving mode
The Relay Proxy version that supports data saving mode will be released as an alpha
version while data saving mode is part of LaunchDarkly’s Early Access Program (EAP). We will release version 9.0 by the end of the EAP.
- Upgrade your Go SDK to version 7.11 or later.
- Request to join the Early Access Program. Wait to receive confirmation from LaunchDarkly that data saving mode is enabled for your account.
- Update your SDK configuration to enable the
DataSystem
configuration option.
Here’s how to enable the DataSystem
configuration option:
The standard data system configuration is recommended 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
.
Node.js (server-side)
Expand Node.js (server-side) code sample
To enable data saving mode:
- If you are using the Relay Proxy, upgrade your Relay Proxy to version 9.0.0-alpha.1 or later.
Relay Proxy version 9 supports data saving mode
The Relay Proxy version that supports data saving mode will be released as an alpha
version while data saving mode is part of LaunchDarkly’s Early Access Program (EAP). We will release version 9.0 by the end of the EAP.
- Upgrade your Node.js (server-side) SDK to version 9.10 or later.
- Request to join the Early Access Program. Wait to receive confirmation from LaunchDarkly that data saving mode is enabled for your account.
- Update your SDK configuration:
- Enable the
dataSystem
configuration option. - Migrate existing
LDOptions
fields. The following existing options were previously top-levelLDOptions
fields and are part of thedataSystem
configuration as of version 9.10:persistentStore
,stream
,streamInitialReconnectDelay
,pollInterval
,useLDD
.
- Enable the
Here’s how to enable the dataSystem
configuration option:
The standard
data source option is recommended 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
.