What is the best way to develop, test and deploy serverless applications which uses AWS services SQS, SES, Lambda

I am trying to develop a serverless application which will use AWS SQS (Simple Queue Service), AWS SES (Simple Email Service) and AWS Lambda. The application will perform these steps:

To test this out, I created the queue, lambda and configured SES, all manually using the web interface at https://aws.amazon.com . For the Lambda function, I simply typed my code in the web IDE provided at Lambda console. Since it was a very simple POC, it didnt need any testing and I got it to work.

Now, I want to turn this into a production ready application. My requirements:

Based on what I read online, I could find 3 different options for doing this:

My questions are:

  1. For my use case, are serverless applications the correct technology or do I need something else like AWS SWF or AWS Step Functions? I also read about AWS Lambda applications. Are they something else?
  2. Which is the best option among these in terms of cost, ease of setup and use? I checked that CloudFormation itself doesnt cost anything, you just have to pay for the services (SQS, SES, Lambda) being used but for Serverless, there are some costs involved for using the framework.
  3. Are there some other options as well apart from these?

I will be using NodeJS for the code and only AWS as my cloud platform.

Upvotes: 0

Views: 628

Answers (1)

s.hesse
s.hesse

Reputation: 2060

Short answer: yes, this is totally doable with Serverless functions and actually a typical Serverless use case.

Long answer:

  1. It's not necessary to use AWS SWF or AWS Step Functions here. However, you could use Step Functions in case your process gets more complicated (e.g. more external services are involved and you need certain error handling, or you want to improve parallel processing powers).

  2. First of all, CloudFront is not comparable to AWS SAM or Serverless Framework. Did you mean AWS CloudFormation instead? CloudFront is a CDN to serve (and cache) any kind of content whereas CloudFormation is a tool to describe your infrastructure as code.

    CloudFormation is the "basis" for AWS SAM and Serverless Framework because they both translate their template code to CloudFormation code in the end. However, CloudFormation makes developing Serverless Functions a bit complicated in my opinion. That's why tools like AWS SAM or Serverless Framework popped up at some point. AWS SAM is basically an extension of CloudFormation, i.e. it provides additional resource types like AWS::Serverless::Function but everything else is CloudFormation. Serverless Framework also lets you add CloudFormation resources but has its own syntax for specifying Serverless Functions.

    In terms of costs, CloudFormation, AWS SAM, and Serverless Framework are all free. However, you can use some premium features of Serverless Framework but you don't have to. However, CloudFront is not free to use - but I believe it wasn't the service you were looking for. Besides that, for SQS, SES and Lambda you only pay for what you use.

    I personally prefer AWS SAM because you are closer to CloudFormation code and compared to Serverless Framework, you don't need a plugin for some things to circumvent the abstractions that the Serverless Framework does for you. You'll notice this for 'bigger' projects where you are leaving the standard hello world examples. On the other side, the Serverless Framework is quite popular and hence, there are many resources out there to help you. Up to you what you prefer :)

  3. In terms of infrastructure tooling, you could have a look at AWS CDK (a good starting point is cdkworkshop.com) which is becoming more and more popular.

    For local development, you can have a look at Localstack. The free version supports emulating SQS and SES locally, so that should be helpful.

Upvotes: 1

Related Questions