Member-only story

3 Ways to Retry Failures In Your Serverless Application

Learn how to handle errors in your event-driven workflows from a low, medium, and high level.

Allen Helton
Better Programming
8 min readJun 8, 2022

Image by jburson from Pixabay

A few years ago when I got into serverless development and event driven architectures, there was so much of mystique and wonder. I didn’t know the purpose of an event bus, I couldn’t wrap my head around asynchronous processes, and I sure couldn’t figure out why you’d need to build retry functionality in an application.

Coming from a strictly synchronous background, retries made no sense. If something didn’t work, just click the button again. While this might be true for a synchronous API call, it is not the case in many serverless environments.

Serverless makes heavy use of events, which are asynchronous in nature. This means the caller does not wait to hear a response before returning. This is a highly effective approach when designing loosely-coupled systems that automatically scale under load. Not to mention it saves you some serious money when Lambda functions don’t have to wait for a process to finish.

When something goes wrong in an asynchronous process, you don’t want it to fail and be lost forever. It’s possible the process failed because of a transient error like a network failure or throttling event. These…

Allen Helton
Allen Helton

Written by Allen Helton

I am an AWS serverless hero with a strong focus on API design and standardization, event-driven architectures, and software automation.

Responses (1)

What are your thoughts?