AWS re:Invent 2025 - [NEW LAUNCH] Deep Dive on AWS Lambda durable functions (CNS380)
This presentation introduces AWS Lambda durable functions, a groundbreaking new capability that simplifies building fault-tolerant applications using familiar programming language patterns in JavaScript, TypeScript, and Python (7:50). The speakers demonstrate how durable functions enable developers to build complex applications like payment systems and user onboarding directly on Lambda, with the ability to test and debug locally before deployment (7:06-7:27).
1. Core Concept and Architecture (7:50)
Simplified Reliable Business Logic
Durable functions allow developers to write reliable business logic as simple, sequential steps, similar to monolithic applications but with all the benefits of serverless architecture (7:53-7:57).
Standard Lambda Functions
- No New Resource Type: Durable functions are regular Lambda functions, not a new AWS resource, meaning you use the same function you know today (8:50-8:55)
- Durable Execution SDK: Core functionality comes from the durable execution SDK, which provides "steps" for checkpointing business logic progress and "waits" for suspending execution (11:53-12:26)
2. Key Features and Capabilities (14:10)
Automatic Reliability Features
- Built-in Retries: Automatic retries with backoff and jitter for transient failures (14:10-14:51)
- Deduplication Logic: Front-end deduplication ensures only one execution runs at a time (14:10-14:51)
- Replay Mechanism: System uses replay to recover from interruptions, ensuring the invocation uses the exact same code version it started with, even if code changes occurred (15:01-15:16)
Long-Running and Human-in-the-Loop Support
Durable functions excel at long-running operations and human-in-the-loop interactions, as the function can suspend execution and resume when a callback is received (7:30-7:37, 22:55-23:19).
3. Getting Started and Configuration (10:46)
Enabling Durable Functions
- Simple Toggle: Enable durable execution with a simple toggle in the Lambda console or through APIs using infrastructure-as-code tools like CloudFormation or CDK (10:46-11:05)
- Configuration Properties: Set the execution timeout (up to one year) for the entire lifecycle and the retention period for checkpoints (11:07-11:47)
SDK Integration
Import the durable execution SDK and use withDurableExecution to wrap your event handler, gaining access to context.step for checkpointing and context.wait for suspension (11:52-12:43).
4. Advanced Patterns and Use Cases (17:56)
Saga Pattern Support
Durable functions simplify implementing the saga pattern for undoing work in distributed architectures, as compensation logic can be encapsulated in reliable steps (17:56-18:19).
Local Testing and Observability
- Local Development: Developers can test and debug durable functions locally before deploying to production (27:07-28:11)
- Console History: The console provides a full history of execution steps for debugging (27:07-28:11)
5. Cost Model and Production Considerations (36:51)
Cost Efficiency
You only pay for the compute time when the function is actively running, not while it's suspended and waiting (36:51-36:54).
Pricing Structure
- Checkpoint Operations: Charges apply per million checkpoint operations (47:58-48:20)
- Storage Dimensions: Costs for data written and retained within checkpoints (47:58-48:20)
- Existing Lambda Charges: Standard Lambda compute charges still apply when the function is running (48:22-48:28)
Production Readiness
Durable functions are designed for production, providing reliable progress and state management without complex infrastructure (36:09).
6. Best Practices and Recommendations (42:58)
Development Best Practices
- Maintain Good Coding Practices: While powerful, it's still recommended to follow good coding practices and avoid building overly monolithic functions, even though the development experience might feel similar (42:58-43:15)
- Use Latest SDK: For the latest features, use your favorite package manager to bundle the SDK directly from the open-source GitHub repositories, as they move faster than bundled runtimes (43:37-43:54)
Choosing Between Durable Functions and Step Functions
The speakers acknowledge the comparison with Step Functions (48:30-48:52) and indicate that both are fantastic services, with a detailed guide available to help choose based on primary focus (49:00-49:16).
Presenters: AWS Lambda Team - Principal Engineers and Product Managers at AWS