

# Best practices for Lambda durable functions
<a name="durable-best-practices"></a>

Durable functions use a replay-based execution model that requires different programming practices than traditional Lambda functions. See [Best practices](https://docs.aws.amazon.com/durable-execution/patterns/best-practices/) in the Amazon Durable Execution SDK Developer Guide for guidance on how to write and test durable workflow code.

The following recommendations are best practices for deploying, invoking, and monitoring Lambda durable functions.

## Function versions and aliases
<a name="durable-versioning"></a>

Invoke functions with version numbers or aliases to pin executions to specific code versions. Ensure new code versions can handle state from older versions. Don't rename steps or change their behavior in ways that break replay.

## Monitoring
<a name="durable-monitoring-best-practices"></a>

Enable structured logging with execution IDs and step names. Set up CloudWatch alarms for error rates and execution duration. Use tracing to identify bottlenecks. For detailed guidance, see [Monitoring and debugging](durable-monitoring.md).

## Related resources
<a name="durable-additional-resources"></a>
+ [Amazon Durable Execution SDK Developer Guide](https://docs.aws.amazon.com/durable-execution/)
+ [Monitoring Lambda durable functions](durable-monitoring.md)
+ [Retries for Lambda durable functions](durable-execution-sdk-retries.md)
+ [Testing Lambda durable functions](durable-testing.md)