Class DynamoDB
Integration between the LaunchDarkly SDK and DynamoDB.
Inheritance
Namespace: LaunchDarkly.Sdk.Server.Integrations
Assembly: LaunchDarkly.ServerSdk.DynamoDB.dll
Syntax
public static class DynamoDB : Object
Fields
DataStorePartitionKey
Name of the partition key that the data store's table must have. You must specify this when you create the table. The key type must be String.
Declaration
public const string DataStorePartitionKey = "namespace"
Field Value
| Type | Description |
|---|---|
| System.String |
DataStoreSortKey
Name of the sort key that the data store's table must have. You must specify this when you create the table. The key type must be String.
Declaration
public const string DataStoreSortKey = "key"
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
BigSegmentStore(String)
Returns a builder object for creating a DynamoDB-backed Big Segment store.
Declaration
public static DynamoDBStoreBuilder<IBigSegmentStore> BigSegmentStore(string tableName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tableName | the DynamoDB table name; this table must already exist |
Returns
| Type | Description |
|---|---|
| DynamoDBStoreBuilder<LaunchDarkly.Sdk.Server.Subsystems.IBigSegmentStore> | a Big Segment store configuration object |
Remarks
You can use methods of the builder to specify any non-default DynamoDB options you may want, before passing the builder to LaunchDarkly.Sdk.Server.Components.BigSegments(LaunchDarkly.Sdk.Server.Subsystems.IComponentConfigurer{LaunchDarkly.Sdk.Server.Subsystems.IBigSegmentStore}). In this example, the store is configured to use a table called "table2":
var config = Configuration.Builder("sdk-key")
.DataStore(
Components.BigSegments(
DynamoDB.BigSegmentStore("table2")
)
)
.Build();
Note that the SDK also has its own options related to Big Segments that are configured at a different level, because they are independent of what database is being used. For instance, the builder returned by LaunchDarkly.Sdk.Server.Components.BigSegments(LaunchDarkly.Sdk.Server.Subsystems.IComponentConfigurer{LaunchDarkly.Sdk.Server.Subsystems.IBigSegmentStore}) has an option for the status polling interval:
var config = Configuration.Builder("sdk-key")
.DataStore(
Components.BigSegments(
DynamoDB.BigSegmentStore("table2")
).StatusPollInterval(TimeSpan.FromSeconds(30))
)
.Build();
DataStore(String)
Returns a builder object for creating a Redis-backed persistent data store.
Declaration
public static DynamoDBStoreBuilder<IPersistentDataStoreAsync> DataStore(string tableName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | tableName | the DynamoDB table name; this table must already exist |
Returns
| Type | Description |
|---|---|
| DynamoDBStoreBuilder<LaunchDarkly.Sdk.Server.Subsystems.IPersistentDataStoreAsync> | a data store configuration object |
Remarks
This is for the main data store that holds feature flag data. To configure a Big Segment store, use BigSegmentStore(String) instead.
You can use methods of the builder to specify any non-default DynamoDB options you may want, before passing the builder to LaunchDarkly.Sdk.Server.Components.PersistentDataStore(LaunchDarkly.Sdk.Server.Subsystems.IComponentConfigurer{LaunchDarkly.Sdk.Server.Subsystems.IPersistentDataStoreAsync}). In this example, the store is configured to use a table called "table1":
var config = Configuration.Builder("sdk-key")
.DataStore(
Components.PersistentDataStore(
DynamoDB.DataStore("table1")
)
)
.Build();
Note that the SDK also has its own options related to data storage that are configured at a different level, because they are independent of what database is being used. For instance, the builder returned by LaunchDarkly.Sdk.Server.Components.PersistentDataStore(LaunchDarkly.Sdk.Server.Subsystems.IComponentConfigurer{LaunchDarkly.Sdk.Server.Subsystems.IPersistentDataStoreAsync}) has options for caching:
var config = Configuration.Builder("sdk-key")
.DataStore(
Components.PersistentDataStore(
DynamoDB.DataStore("table1")
).CacheSeconds(15)
)
.Build();