LaunchDarkly Server-Side SDK for .NET - DynamoDB integration
The minimum version of the LaunchDarkly .NET SDK for use with this library is 5.6.0.
For more information, see also: Using a persistent feature store.
.NET platform compatibility
This version of the library is compatible with .NET Framework version 4.5 and above, .NET Standard 1.6, and .NET Standard 2.0.
In DynamoDB, create a table which has the following schema: a partition key called "namespace" and a sort key called "key", both with a string type. The LaunchDarkly library does not create the table automatically, because it has no way of knowing what additional properties (such as permissions and throughput) you would want it to have.
Use NuGet to add this package to your project:
Import the package (note that the namespace is different from the package name):
When configuring your
LDClient, add the DynamoDB feature store:
Configuration ldConfig = Configuration.Default("YOUR_SDK_KEY") .WithFeatureStoreFactory(DynamoDBComponents.DynamoDBFeatureStore("my-table-name")); LdClient ldClient = new LdClient(ldConfig);
Optionally, you can change the DynamoDB configuration by calling methods on the builder returned by
Configuration ldConfig = Configuration.Default("YOUR_SDK_KEY") .WithFeatureStoreFactory( DynamoDBComponents.DynamoDBFeatureStore("my-table-name") .WithCredentials(new BasicAWSCredentials("my-key", "my-secret")) ); LdClient ldClient = new LdClient(ldConfig);
If you are running a LaunchDarkly Relay Proxy instance, you can use it in daemon mode, so that the SDK retrieves flag data only from Redis and does not communicate directly with LaunchDarkly. This is controlled by the SDK's
Configuration ldConfig = Configuration.Default("YOUR_SDK_KEY") .WithFeatureStoreFactory(DynamoDBComponents.DynamoDBFeatureStore("my-table-name")) .WithUseLdd(true); LdClient ldClient = new LdClient(ldConfig);
To reduce traffic to DynamoDB, there is an optional in-memory cache that retains the last known data for a configurable amount of time. This is on by default; to turn it off (and guarantee that the latest feature flag data will always be retrieved from DynamoDB for every flag evaluation), configure the builder as follows:
Or, to cache for longer than the default of 30 seconds:
The published version of this assembly is strong-named. Building the code locally in the default Debug configuration does not use strong-naming and does not require a key file.
This project imports the
dotnet-server-sdk-shared-tests repositories as subtrees. See the
README.md file in each of those directories for more information.
To run unit tests, you must have a local DynamoDB server. More information here.
Releases are done using the release script in
dotnet-base. Since the published package includes a .NET Framework 4.5 build, the release must be done from Windows.
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out our documentation for a complete list.
- Explore LaunchDarkly