0

I am new to aws. I read few articles to directly connect api gateway to DynamoDB and few used lambda to route the requests. I want to understand in what cases we need lambda and when we can avoid it.

1 Answer 1

2

It is super-convenient that API Gateway can insert directly into DynamoDB. Many times that is sufficient. There may be times when you need to do "a little more" than just insert into DynamoDB. For example, you may need to:

  1. Append some additional data to items going into a DynamoDB table (like a postal code)
  2. Reformat some of the data (like split a name field into first name and last name)
  3. Execute some other action (like also insert into an RDS database)

Processing a DynamoDB stream is another way in which you might handle those actions. However, DynamoDB stream processing happens asynchronously so you cannot immediately report a failure back through the original API Gateway endpoint. For example, if there's a problem in the Lambda you may want to have the API Gateway endpoint reply with an appropriate HTTP status code so that the caller knows about the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.