[{"data":1,"prerenderedAt":59},["ShallowReactive",2],{"pattern-saga-pattern-lambda-durable-functions":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":28,"language":35,"level":36,"meta":37,"patternArch":38,"resources":43,"s3URL":6,"services":6,"stem":54,"testing":55,"videoId":6,"__hash__":58},"patterns\u002Fpatterns\u002Fsaga-pattern-lambda-durable-functions.json","Saga Pattern with AWS Lambda durable functions",null,{"text":8},[9],"Delete the stack: \u003Ccode>cdk destroy\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fben-freiberg.json",{"text":13},[14,15,16,17,18],"cd saga-pattern-cdk","npm install",".\u002Fbuild-layer.sh","cdk bootstrap (first time only)","cdk deploy","Implement the saga pattern for distributed transactions using AWS Lambda durable functions with automatic compensating transactions.","json","AWS CDK",{"template":23},{"repoURL":24,"templateURL":25,"projectFolder":26,"templateFile":27},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fsaga-pattern-lambda-durable-functions","serverless-patterns\u002Fsaga-pattern-lambda-durable-functions","saga-pattern-lambda-durable-functions","saga-pattern-cdk\u002Flib\u002Fsaga-pattern-cdk-stack.ts",{"headline":29,"text":30},"How it works",[31,32,33,34],"This pattern demonstrates how to implement the saga pattern for distributed transactions using AWS Lambda durable functions. The example implements a travel booking system that coordinates flight, hotel, and car reservations with automatic compensating transactions (rollbacks) on failure.","The saga orchestrator is a durable Lambda function that invokes individual service functions sequentially. If any service fails, the orchestrator automatically executes compensating transactions in reverse order to maintain data consistency.","Durable functions track progress, automatically retry on failures, and can suspend execution for up to one year at defined points without paying for idle compute during waits.","This pattern deploys one durable Lambda function (orchestrator), six service Lambda functions (reserve\u002Fcancel for flight, hotel, car), three Amazon DynamoDB tables, and one Amazon SQS dead letter queue.","Python","300",{},{"icon1":39},{"x":40,"y":40,"service":41,"label":42},50,"lambda-durable-functions","AWS Lambda durable functions",{"bullets":44},[45,48,51],{"text":46,"link":47},"AWS Lambda Durable Functions Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-functions.html",{"text":49,"link":50},"Saga Pattern Overview","https:\u002F\u002Fmicroservices.io\u002Fpatterns\u002Fdata\u002Fsaga.html",{"text":52,"link":53},"Best Practices for Lambda Durable Functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-best-practices.html","patterns\u002Fsaga-pattern-lambda-durable-functions",{"text":56},[57],"See the GitHub repo README for detailed testing instructions including success and failure scenarios.","Mk9fyl_nm3LfrAW9uv5Wy6DWoji4p-pf7g_8MqoufO8",1784543724024]