AWS Lambdas Can Have Shared State

Step Functions allow lambdas to share state without involving DynamoDB or any other data storage service

Obie Fernandez
In Pursuit of Serverless Architecture
6 min readApr 24, 2019

--

AWS Lambda functions are widely regarded as being stateless, that is, whatever data they want to persist between function invocations has to be stored somewhere other than the lambda’s memory space. It’s a fundamental limitation that limits the applicability of lambda functions for use in domains where the cost impact of constant round-trips to data storage makes the overall approach too slow and expensive.

The stateless limitation is fodder for commentary such as Jonas Boner’s argument that Serverless Needs a Bolder, Stateful Vision, where he makes the case for needing programming models different than just Functions as a Service (FaaS), and that the main reason for that is that FaaS functions are stateless.

Just like Jonas and everyone else, I’ve taken stateless limitations for granted ever since I got started with AWS Lambda. It probably didn’t feel like a big deal to me given my background with Ruby on Rails. Each request to a Rails app is stateless. With its horizontally-scaling architecture, Rails simply has no reliable provision for storing data in process memory. You need stateful data? You put it in the database or a cache of some sort. I kind of sorta…

--

--

Obie Fernandez
In Pursuit of Serverless Architecture

CEO of RCRDSHP, Published Author, and Software Engineer. Chief Consultant at MagmaLabs. Electronic Music Producer/DJ. Dad. ❤️‍🔥Mexico City ❤️‍🔥 LatinX (he/him