-
Hi, Looking at the docs of the DynamoDbCache object (link to DynamoDbCache docs), Going over at the dynamodb table itself - all records have the same partition key "responses" (see attached image) I feel like it missed the whole point of using dynamodb (which is a fully managed database) Why doesn't it use the cache key as the partition key? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for bringing this up. The short answer is that you're correct; the cache key is currently used as the range key, but would be better as the partition key. The longer answer is that there is a second namespace, However, since the 1.0 release is coming soon, this would be as good a time as any to make some backwards-incompatible improvements. There are a couple different options, but probably the easiest would be to use two separate tables, remove What do you think? And is that something you would be interested in working on? |
Beta Was this translation helpful? Give feedback.
Thanks for bringing this up. The short answer is that you're correct; the cache key is currently used as the range key, but would be better as the partition key.
The longer answer is that there is a second namespace,
redirects
, which optimizes redirect chains by mapping the cache key of the initial request to the cache key of the final request in the chain. Other backends use a separate table to store this redirect info, but the DynamoDB backend uses a single table with two different "namespaces" (partition key values). That was done in the initial implementation here before I came on board as maintainer, and I did not want to break backwards-compatibility.However, since the 1.0 release …