I created an email form on my website that calls an API Gateway endpoint as my HTML form action. It delivers the payload (a few lines of text generally) to the endpoint which triggers my AWS Lambda func. This works as planned, but it's a little slow (2-5 seconds) as sending email via SES takes a few seconds.
I'd like to use an in-memory datastore like Redis or Memcached to just set the data and close the Lambda func., but this seems expensive for my limited use case - I get 10-15 emails per month.
Is a better use case delivering the payload to an API Gateway endpoint - same as before - but have the AWS Lambda func. save the data immediately to an AWS DynamoDb instance which then closes the connection (terminates the AWS Lambda func.) ... and behind the scenes a second AWS Lambda func. would invoke/trigger that would then deliver the email to the appropriate account?
The delay I'm having appears to be the actual sending of the email using AWS SES so I'm trying to make this faster. I can do the above or is there a better way to invoke an SES instance to send email ... maybe async. somehow?
The usual pattern for this sort of thing is to push the data into a queue and have a second lambda consume it (to actually send the email). For this volume, the free tier should be plenty :)