Skip to content

Commit 4565582

Browse files
authored
Update README.md
1 parent e88bd70 commit 4565582

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1+
12
# Albelli.Extensions.Caching.DynamoDb
23
This library offers an implementation of IDistributedCache with a DynamoDb back-end.
34
It makes use of the TTL functionality to get remove the stale cache keys.
45
IDistributedCache is a low-level interface used by cache-related consumers, such as Polly. Microsoft also provides a set of extension methods that simplify common workflows.
56

7+
## Usage
8+
First, install the package through NuGet
9+
10+
Install-Package Albelli.Extensions.Caching.DynamoDb
11+
Then you can inject it through Microsoft's DI container. Example:
12+
13+
services.AddDynamoDbCache(
14+
o =>
15+
{
16+
o.TableName = "CustomerSubscriptions-Caching";
17+
});
18+
That's it! This will be injected as a singleton. Afterwards, you have access to the IDistributedCache in your application.
19+
Bear in mind, this has a dependency on AmazonDynamoDBClient client.
20+
You can either make sure it's injected in the DI engine or use:
21+
22+
23+
services.AddDynamoDbCache(
24+
o =>
25+
{
26+
...
27+
o.CustomDynamoDbClient = new AmazonDynamoDBClient();
28+
...
29+
});
30+
631
## Considerations
732
- There is no optimistic locking(or locking of any kind). If this is a big problem, using a different provider(such as Redis with WATCH) might be better for your use case.
833
- Eventual consistency is used.
@@ -17,3 +42,4 @@ IDistributedCache is a low-level interface used by cache-related consumers, such
1742
- The library is still **quite raw**. Any pull requests, ideas and feedback are encouraged.
1843

1944

45+

0 commit comments

Comments
 (0)