DynamoDB Item Insert Limit

0

Is there a way to limit the number of items inserted in a DynamoDB by user ID. I have an alexa skill that i want to limit the number of items added to table by the alexa user ID? Or is there a way to have DynamoDB table count the unique user ids and limit insert for each id after, for example, 5 entries? So, every unique user id can only have 5 entries.

llmcd
질문됨 2년 전623회 조회
2개 답변
1

For this you would need to keep a counter record for each item and use DynamoDB Transactions to achieve your use case. For each AlexaID create a record for storing counts of records:

PkSkItems
AlexaIdCounter3

Then you would use a TransactWrite with a condition for each new write, and also an Update to update the counter.

TransactWrite:
Put - new item
Update - update counter ++
Condition - if counter record Items value < 6
profile pictureAWS
전문가
답변함 2년 전
0

There is not a way to have this enforced automatically. You'd have to keep a counter yourself and have your application code ensure requests were rejected that exceeded your limit.

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠