Saga Pattern

A failure management management pattern that coordinates transactions between multiple microservices to maintain data consistency.

The following workflow diagram illustrates the typical flow of the travel reservation system. The workflow consists of reserving air travel, reserving a car, processing payments, confirming flight reservations, and confirming car rentals followed by a success notification when these steps are complete. However, if the system encounters any errors in running any of these transactions, it starts to fail backward. For example, an error with payment processing triggers a refund, which then triggers a cancellation of the rental car and flight, which ends the entire transaction with a failure message.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/saga-pattern-tf/cd step-functions-workflows-collection/saga-pattern-tf

Deploy

terraform initterraform apply


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: terraform destroy.

Additional resources

Created by:

Rohan Mehta

Rohan Mehta

Associate Cloud Application Architect at AWS.

Tabby Ward

Tabby Ward

Principal Architect

Follow on LinkedIn