![]() |
VOOZH | about |
dotnet add package Excalibur.Data.DynamoDb --version 3.0.0-alpha.208
NuGet\Install-Package Excalibur.Data.DynamoDb -Version 3.0.0-alpha.208
<PackageReference Include="Excalibur.Data.DynamoDb" Version="3.0.0-alpha.208" />
<PackageVersion Include="Excalibur.Data.DynamoDb" Version="3.0.0-alpha.208" />Directory.Packages.props
<PackageReference Include="Excalibur.Data.DynamoDb" />Project file
paket add Excalibur.Data.DynamoDb --version 3.0.0-alpha.208
#r "nuget: Excalibur.Data.DynamoDb, 3.0.0-alpha.208"
#:package Excalibur.Data.DynamoDb@3.0.0-alpha.208
#addin nuget:?package=Excalibur.Data.DynamoDb&version=3.0.0-alpha.208&prereleaseInstall as a Cake Addin
#tool nuget:?package=Excalibur.Data.DynamoDb&version=3.0.0-alpha.208&prereleaseInstall as a Cake Tool
AWS DynamoDB data provider implementation for Excalibur cloud-native data access.
This package provides a cloud-native data access implementation for AWS DynamoDB, implementing ICloudNativePersistenceProvider from Excalibur.Data.Abstractions.
TransactWriteItemsdotnet add package Excalibur.Data.DynamoDb
services.AddDynamoDb(options =>
{
options.Connection.Region = "us-east-1";
options.DefaultTableName = "MyTable";
options.DefaultPartitionKeyAttribute = "pk";
options.DefaultSortKeyAttribute = "sk";
});
services.AddDynamoDb(Configuration.GetSection("DynamoDb"));
{
"DynamoDb": {
"DefaultTableName": "MyTable",
"DefaultPartitionKeyAttribute": "pk",
"DefaultSortKeyAttribute": "sk",
"UseConsistentReads": false,
"Connection": {
"Region": "us-east-1",
"TimeoutInSeconds": 30,
"MaxRetryAttempts": 3
}
}
}
If you already have an IAmazonDynamoDB client configured:
services.AddSingleton<IAmazonDynamoDB>(sp => new AmazonDynamoDBClient());
services.AddDynamoDbWithClient(options =>
{
options.DefaultTableName = "MyTable";
});
DynamoDbOptions)| Option | Default | Description |
|---|---|---|
Name |
DynamoDb |
Provider instance name for identification |
DefaultTableName |
Required | Default table for operations |
DefaultPartitionKeyAttribute |
pk |
Partition key attribute name |
DefaultSortKeyAttribute |
sk |
Sort key attribute name |
UseConsistentReads |
false |
Enable strongly consistent reads by default |
EnableStreams |
false |
Enable DynamoDB Streams for change data capture |
StreamViewType |
NEW_AND_OLD_IMAGES |
What data to include in stream records |
DynamoDbConnectionOptions)Access via options.Connection.*:
| Option | Default | Description |
|---|---|---|
Region |
null | AWS region (e.g., "us-east-1") |
ServiceUrl |
null | Custom service URL (for local development) |
AccessKey |
null | AWS access key (optional, uses default credentials if not set) |
SecretKey |
null | AWS secret key (optional, uses default credentials if not set) |
TimeoutInSeconds |
30 |
Request timeout |
MaxRetryAttempts |
3 |
Maximum retry attempts for transient failures |
ReadCapacityUnits |
null | On-demand scaling hint for reads |
WriteCapacityUnits |
null | On-demand scaling hint for writes |
| Option | Default | Description |
|---|---|---|
EnableStreams |
false |
Enable DynamoDB Streams for change data capture |
StreamViewType |
NEW_AND_OLD_IMAGES |
What data to include in stream records |
Stream View Types:
KEYS_ONLY - Only the key attributesNEW_IMAGE - The entire item after modificationOLD_IMAGE - The entire item before modificationNEW_AND_OLD_IMAGES - Both the new and old item imagespublic class MyService
{
private readonly ICloudNativePersistenceProvider _provider;
public MyService(ICloudNativePersistenceProvider provider)
{
_provider = provider;
}
public async Task<Order?> GetOrderAsync(string customerId, string orderId)
{
return await _provider.GetByIdAsync<Order>(
orderId,
new PartitionKey(customerId));
}
public async Task CreateOrderAsync(Order order)
{
await _provider.CreateAsync(
order,
new PartitionKey(order.CustomerId));
}
public async Task<IReadOnlyList<Order>> GetCustomerOrdersAsync(string customerId)
{
return await _provider.QueryAsync<Order>(new PartitionKey(customerId));
}
}
// Batch create
var items = new[] { order1, order2, order3 };
await _provider.BatchCreateAsync(
items,
item => new PartitionKey(item.CustomerId));
// Batch replace with optimistic concurrency
await _provider.BatchReplaceAsync(
items,
item => new PartitionKey(item.CustomerId),
item => item.ETag);
var subscription = await _provider.CreateChangeFeedSubscriptionAsync<Order>(
"Orders",
new ChangeFeedOptions
{
StartPosition = ChangeFeedStartPosition.Beginning,
MaxBatchSize = 100
});
await foreach (var change in subscription.ReadChangesAsync(cancellationToken))
{
Console.WriteLine($"{change.EventType}: {change.DocumentId}");
if (change.Document != null)
{
// Process the changed document
}
}
Note: DynamoDB Streams must be enabled on the table for change feed to work.
services.AddHealthChecks()
.AddCheck<DynamoDbHealthCheck>("dynamodb");
For local development with DynamoDB Local:
services.AddDynamoDb(options =>
{
options.Connection.ServiceUrl = "http://localhost:8000";
options.DefaultTableName = "LocalTable";
});
This provider follows the single-table design pattern commonly used with DynamoDB:
Documents are serialized to/from DynamoDB using JSON, with partition and sort keys automatically managed.
Batch operations use DynamoDB's TransactWriteItems for atomic, all-or-nothing operations:
// All items are created atomically
await _provider.BatchCreateAsync(items, item => new PartitionKey(item.Id));
The provider maps DynamoDB exceptions to CloudOperationResult<T>:
var result = await _provider.UpdateAsync(order, partitionKey, etag);
if (!result.Success)
{
switch (result.StatusCode)
{
case 400:
Console.WriteLine("Validation error or bad request");
break;
case 404:
Console.WriteLine("Item not found");
break;
case 409:
Console.WriteLine("Conditional check failed (item already exists)");
break;
case 412:
Console.WriteLine("Precondition failed (ETag/version mismatch)");
break;
case 429:
Console.WriteLine("Provisioned throughput exceeded - retry with backoff");
break;
}
}
| Exception | HTTP Status | Description |
|---|---|---|
ConditionalCheckFailedException |
409/412 | Condition expression evaluated to false |
ProvisionedThroughputExceededException |
429 | Exceeded provisioned capacity |
ResourceNotFoundException |
404 | Table or item not found |
TransactionCanceledException |
409 | Transaction failed (conflicts) |
ItemCollectionSizeLimitExceededException |
400 | Item collection too large (10GB limit) |
DynamoDB supports multiple authentication methods:
// Uses default credentials chain (EC2 instance profile, ECS task role, etc.)
services.AddDynamoDb(options =>
{
options.Connection.Region = "us-east-1";
options.DefaultTableName = "MyTable";
});
services.AddDynamoDb(options =>
{
options.Connection.Region = "us-east-1";
options.Connection.AccessKey = "YOUR_ACCESS_KEY";
options.Connection.SecretKey = "YOUR_SECRET_KEY";
options.DefaultTableName = "MyTable";
});
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_REGION="us-east-1"
ConsumedCapacity in responsesProvisionedThroughputExceededExceptionSee LICENSE files in the repository root.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Excalibur.Data.DynamoDb:
| Package | Downloads |
|---|---|
|
Excalibur.EventSourcing.DynamoDb
AWS DynamoDB event store implementation for Excalibur event sourcing. |
|
|
Excalibur.Outbox.DynamoDb
AWS DynamoDB implementation of the cloud-native outbox pattern for Excalibur event sourcing. |
|
|
Excalibur.Inbox.DynamoDb
Amazon DynamoDB implementation of the inbox pattern for Excalibur, providing idempotent message processing. |
|
|
Excalibur.Cdc.DynamoDb
Amazon DynamoDB Streams Change Data Capture (CDC) implementation for Excalibur. |
|
|
Excalibur.Saga.DynamoDb
Amazon DynamoDB saga store implementation for Excalibur. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.208 | 73 | 6/11/2026 |
| 3.0.0-alpha.207 | 69 | 6/11/2026 |
| 3.0.0-alpha.205 | 71 | 6/10/2026 |
| 3.0.0-alpha.204 | 79 | 6/8/2026 |
| 3.0.0-alpha.203 | 79 | 6/8/2026 |
| 3.0.0-alpha.202 | 76 | 6/8/2026 |
| 3.0.0-alpha.201 | 82 | 6/8/2026 |
| 3.0.0-alpha.199 | 69 | 6/8/2026 |
| 3.0.0-alpha.198 | 83 | 5/28/2026 |
| 3.0.0-alpha.197 | 87 | 5/28/2026 |
| 3.0.0-alpha.194 | 81 | 5/20/2026 |
| 3.0.0-alpha.193 | 81 | 5/13/2026 |
| 3.0.0-alpha.192 | 85 | 5/13/2026 |
| 3.0.0-alpha.191 | 75 | 5/13/2026 |
| 3.0.0-alpha.189 | 88 | 5/12/2026 |
| 3.0.0-alpha.187 | 81 | 5/8/2026 |
| 3.0.0-alpha.185 | 94 | 5/7/2026 |
| 3.0.0-alpha.183 | 82 | 5/7/2026 |
| 3.0.0-alpha.182 | 83 | 5/6/2026 |
| 3.0.0-alpha.181 | 82 | 5/6/2026 |