This may not be the correct forum for these questions in many ways, but perhaps someone may have some ideas
I am working on an 'email integration' project where most likely I will have to deliver thousands of emails based on certain events.
So for example some events are:
- single events e.g. SendNewUserRegistrationEmail
- some events are periodic events based on time
- and some could be classified as batch events e.g SendImportantMessageToAllUsers
I have used AWS Lambda recently on another project and really loving the serverless element of things i.e. not have to worry about a 'running' server or scaling / bottleneck issues. I am hoping that I can apply a serverless architecture to my current project using AWS infrastructure. I am also hoping to keep things as simple and un complicated as possible.
For my SendNewUserRegistrationEmail use case I would assume this would be pretty straight forward
- A source posts a userId to a AWS Lambda 'SendNewUserRegistrationEmail' endpoint
- The Lambda function looks up user details by the user Id, builds up a html email message with the user details and send calls SES to deliver the email
For time based events I guess I can just used Lambda 'Scheduled events' , I assume this is easy to configure with the ServerLess Framework ?
But the most thing that is bothering me is how I am going to handle batch events like SendImportantMessageToAllUsers. Assume that although each email will have more or less the same content, it might have some content specific to that user. Obviously a Lambda function cannot to any batch processing on its own due to timeout constraints so I am trying to understand how this use case could be fulfilled in a serverless situation. Would anyone have any suggestions:
Would I need some kind of a source to basically generate an individual event for each email recipient. e.g. a kenesis event for each email? and have each of these kenesis events consumed by an individual Lambda function which would build the email and call SES.
and how could I generate all these events inside a serverless architecture from one simple trigger ?
hope someone might be able to help
thanks a lot