You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The todo_id is randomly generated. Thus, when the function fails after the new todo is saved, the function will be retried and create a new todo again with a different todo_id. Similar issue exists in aws-python-rest-api-with-dynamodb/todos.
This can be fixed by making the function idempotent. We can use the awsRequestId to be todo_id. This is a unique identifier provided by AWS Lambda and is the same in retries. Then the function will create only one new todo. Another way to fix it is requiring the client to provide a parameter to be todo_id. The client can generate such an identifier via uuid API.
The text was updated successfully, but these errors were encountered:
The function
create
under aws-python-http-api-with-pynamodb example is not idempotent and may create multiple extra todos.The
todo_id
is randomly generated. Thus, when the function fails after the new todo is saved, the function will be retried and create a new todo again with a differenttodo_id
. Similar issue exists in aws-python-rest-api-with-dynamodb/todos.This can be fixed by making the function idempotent. We can use the
awsRequestId
to betodo_id
. This is a unique identifier provided by AWS Lambda and is the same in retries. Then the function will create only one new todo. Another way to fix it is requiring the client to provide a parameter to betodo_id
. The client can generate such an identifier viauuid
API.The text was updated successfully, but these errors were encountered: