DEV Community

Jay Sitapara
Jay Sitapara

Posted on • Updated on

How much it Costs to Run a Mass Emailing Platform built using AWS Lambda?

New York Times sends out 4 Billion emails per year. That's a huge number! Although we don't send out these many emails, we send out half a million emails per year which are mostly transactional emails and newsletter.

Last year, we built an emailing platform for our internal use. What we wanted was an easy-to-use platform with minimal UI. We were successful for almost a half year.

But then came,

  • Cost
  • Performance
  • Scalability

And so, we jumped to AWS Lambda and took an oath not to use any traditional servers. As of today, we are fully event-driven using AWS Lambda as our computing service, using Serverless Framework and written in Node.Js. Since we all know how performance and scalability are accelerated with AWS Lambda, in this post, I am going to talk about how we are saving money as well.

Before moving to AWS Lambda, we were fully operational on EC2. We were using t2.small instance which costed us

$0.023 * 24 hours * 30 days * 12 months = $198.72

IMAGE

With AWS Lambda and Simple Email Service SES, we built an in-house and cost-effective solution. Here's how it works,

  • With S3, we store our CSV files, where you can quickly send HTML or text-based emails to a large number of recipients.
  • We've integrated CloudWatch with AWS Lambda, which sends out periodic newsletters based on the pre-set triggers.
  • Or whenever a user uploads a CSV file in S3, it triggers our Lambda function which sends email through SES.

How much it costs?

  • $0 for Lambda since 1M req/month are free.
  • $4.10 for SES
  • $0.02 for standard 1GB S3 storage.

Which sums up to $49.44/year. Sounds too good to be true, right? But it's not. This was just the tip of the serverless cost-berg. We've compiled a detailed analysis on AWS Lambda Pricing: How Much it Costs to Run a Serverless Application?

Also, AWS Lambda empowers you to do some of the exception stuff. If you're wondering where to get started, we have got a detailed list for you: 10 AWS Lambda Use Cases to Start Your Serverless Journey

Feel free to share your experience and suggestions. Connect with on Twitter @jsitapara to talk anything about serverless, AWS Lambda and anything in-between.

Top comments (5)

Collapse
 
erebos-manannan profile image
Erebos Manannán • Edited

$0 + $4.10 + $0.02 = $49.44

Sounds like you skipped a few steps, like the fact that you're giving costs per month, and total per year.

Collapse
 
jsitapara profile image
Jay Sitapara

Yes. Thanks for suggesting. I've edited for better understanding.

Collapse
 
dkkumargoyal profile image
Deepak Goyal

A good use case for lambda. However not mentioning anything about lambda execution time which is the main component of lambda costing. You can check my blog post theabcofcloud.com/lambda-vs-ec2-cost/ for different use cases for lambda and ec2 costs

Collapse
 
indikaanu83 profile image
Anuradha

Is this setup eligible for the SES free tier?

Collapse
 
mwascak profile image
Matt Wascak

Where you doing S/MIME and DKIM with Lambda as well?