What you need to know to build a serverless communication system

How our startup designed an event-driven architecture to automate e-mails in a cost effective way

Garrett Vargas
The Startup

--

As part of our product, LegUp communicates with families and day care providers. Automating this workflow is an important part of our ability to scale. As a scrappy startup, we wanted a solution that allows us to build something scalable at an affordable price. We decided to use AWS’s Simple Email Service (SES) to help manage our e-mails. To provide scalability and avoid throttling when sending bulk e-mails, we built an event-driven system. This system integrates with Simple Queue Service (SQS) and Simple Notification Service (SNS). It is managed through a Lambda function.

If you’ve tried using SQS or other event-bases systems, you’ve likely encountered the problem of idempotency. The same message can be delivered multiple times.

If you’ve tried using SQS or other event-bases systems, you’ve likely encountered the problem of idempotency. The same message can be delivered multiple times. Additionally SNS can return details of message receipt before SES returns. This gives you a lot to manage to ensure that you send outgoing mails once and only once! In this blog post, I’ll explain howLegUp set this up to deal with these issues and provide some Typescript code snippets.

--

--

Garrett Vargas
The Startup

Co-founder and CTO at LegUp | Former CTO at CarRentals.com (Expedia) | Latino father of 2 | Lifelong learner | Leader of global tech teams and active coder