{"id":16771972,"url":"https://github.com/eddmann/aws-eventbridge-choreographed-saga","last_synced_at":"2025-06-14T21:36:11.963Z","repository":{"id":244191582,"uuid":"813486204","full_name":"eddmann/aws-eventbridge-choreographed-saga","owner":"eddmann","description":"Example of an choreographed saga to handle order fulfilment using a Event-Driven Architecture (EDA) via AWS EventBridge.","archived":false,"fork":false,"pushed_at":"2024-06-19T06:30:16.000Z","size":419,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T03:26:41.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eddmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-11T07:20:25.000Z","updated_at":"2024-06-19T06:30:19.000Z","dependencies_parsed_at":"2024-06-13T10:46:54.792Z","dependency_job_id":"77cb3cb0-32b6-4bb5-888f-694fa86238c0","html_url":"https://github.com/eddmann/aws-eventbridge-choreographed-saga","commit_stats":null,"previous_names":["eddmann/aws-eventbridge-choreographed-saga"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddmann%2Faws-eventbridge-choreographed-saga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddmann%2Faws-eventbridge-choreographed-saga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddmann%2Faws-eventbridge-choreographed-saga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddmann%2Faws-eventbridge-choreographed-saga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddmann","download_url":"https://codeload.github.com/eddmann/aws-eventbridge-choreographed-saga/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243895826,"owners_count":20365279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T06:29:35.477Z","updated_at":"2025-03-16T16:27:39.199Z","avatar_url":"https://github.com/eddmann.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Choreographed Saga using AWS EventBridge\n\nExample of an choreographed saga to handle order fulfillment using a Event-Driven Architecture (EDA) via AWS EventBridge.\nInspired by an example found in the [Monolith to Microservices](https://samnewman.io/books/monolith-to-microservices/) book.\n\nEvents are published in [CloudEvents](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md) [structured mode](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#message) message format.\n\n\u003cimg src=\"example.png\" style=\"max-width:800px\"\u003e\n\n## Bounded Contexts\n\n- Order\n- Warehouse\n- Payment\n- Loyalty\n\n## Events\n\n- `order.placed`\n- `warehouse.stock-reserved`\n- `warehouse.order-shipped`\n- `payment.taken`\n- `loyalty.points-awarded`\n\n## Happy Path\n\n- Order is placed (via HTTP endpoint).\n- Stock is reserved (via SQS FIFO Lambda worker, self-handling deduplication).\n- Payment is taken (via SQS Lambda worker, handles deduplication within the service).\n- Loyalty points are awarded (via internal Loyalty Event Bus, direct Lambda invocation and handling deduplication within the service).\n- Order is shipped (via SQS FIFO Lambda worker, self-handling deduplication).\n- Order notifications API endpoint is subsequently then notified of the shipped order.\n\nAll events emitted on the Global Events Bus can be observed via:\n\n- The SQS local polling worker (`QUEUE=sqs_arn node ./observability-polling-worker/app.js`).\n- The CloudWatch Logs integration.\n\n## TODO\n\n- Look at examples of out-of-order processing (domain-specific saga patterns and time-based buffer windows).\n- Look into Event Catalogues and Event Schema Definitions.\n- Look into unhappy paths and how to 'rollback' the saga.\n\n## Resources\n\n- https://aws.amazon.com/blogs/compute/sending-and-receiving-cloudevents-with-amazon-eventbridge/\n- https://serverlessland.com/event-driven-architecture/idempotency\n- https://serverlessland.com/event-driven-architecture/ordering\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddmann%2Faws-eventbridge-choreographed-saga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddmann%2Faws-eventbridge-choreographed-saga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddmann%2Faws-eventbridge-choreographed-saga/lists"}