Each SDK connects to several LaunchDarkly web services. These include services for getting feature flag data via streaming or polling, and a service for storing analytics events. By default, the SDK connects directly to LaunchDarkly for these services.
If you are using the Relay Proxy, you must configure the SDK so that it connects to the Relay Proxy for these services instead.
To use the Relay Proxy in daemon mode, you must first configure your server-side SDK to use a persistent data store. The SDK and the Relay Proxy must use the same data store. To configure your SDK to use a persistent data store, read Storing Data.
Then, you must configure your SDK to use daemon mode, as shown in the following examples. When you use the Relay Proxy in daemon mode, the SDK must not connect to any service for flag data.
When you configure the SDK so that it connects to the Relay Proxy, rather than to LaunchDarkly, for getting feature feature flag data, this mode has different names in different SDKs and SDK versions.
Some versions of the SDKs refer to this as using “external updates only.” Other versions of the SDKs refer to this as “LDD mode,” because the Relay Proxy was previously known as the LaunchDarkly Daemon. Some SDKs, such as the C++ (server-side) SDK, refer to this mode as “lazy load,” because flag data is loaded from the persistent store lazily, on demand as the SDK requests it. In most SDKs, you then need to pass the configuration in as a parameter when you initialize the client. To learn more, read Configuration.
This feature is not available for client-side SDKs because in daemon mode, the SDK connects directly to the Relay Proxy’s data store. This is not a supported behavior for client-side SDKs.
This feature is available for the following server-side SDKs:
Use the DataStore builder method to set a persistent feature store. Then, use the DataSource builder method and Components.ExternalUpdatesOnly to configure daemon mode:
If you are using the newer DataSystem configuration added in .NET SDK 8.11+, use the DataSystem builder with Components.DataSystem().Daemon() to configure daemon mode:
Use LazyLoadBuilder to set a persistent feature store:
Set the feature_store property to use a persistent data store. Then set the use_ldd property to configure daemon mode:
Use PersistentDataStore() to set the persistent data store. Then, use ExternalUpdatesOnly() to configure daemon mode:
Use configSetStoreBackend to set the persistent data store. Then, use configSetUseLdd to configure daemon mode:
Set the dataStore property to persistentDataStore() to use the persistent data store. Then, set the dataSource property to externalUpdatesOnly() to configure daemon mode:
If you are using the newer DataSystem configuration added in Java SDK 7.11+, use the dataSystem builder with Components.dataSystem().daemon() to configure daemon mode:
Specify a lazyLoad data source to set a persistent feature store:
To learn more about the configuration options, read clientInit.
Set the featureStore property to use a persistent feature store. Then, set the useLdd property to configure daemon mode:
Set the feature_requester property to use a persistent data store and daemon mode:
Set the feature_store property to use a persistent data store. Then, set the use_ldd property to configure daemon mode:
Set the feature_store property to use a persistent feature store. Then, set the use_ldd property to configure daemon mode:
If you are using the newer DataSystem configuration added in Ruby SDK 8.12.0+, use the data_system_config option with LaunchDarkly::DataSystem.daemon() to configure daemon mode:
Using the PersistentDataStoreBuilder, provide a persistent store factory.
Enable daemon mode by calling daemon_mode(true) on the ConfigBuilder: