Given a new requirement — when a customer closes their last account, cancel any active cards and notify the credit bureau — how would you design this as a saga, and would you choose choreography or orchestration?
This is a short, linear process — close the account, cancel any active cards, notify the credit bureau — so it's a reasonable candidate for either pattern, but the deciding factor is how many steps it's likely to grow into and whether an audit trail matters. Modeled as choreography, an Account service would publish an AccountClosedEvent when the last account closes, a Card service would listen and cancel any active cards while publishing a CardsCancelledEvent, and a credit bureau notification service would listen for that and send the notification — each service knowing only about the event it reacts to. If this process needs to guarantee, auditably, that a notification never gets skipped, or if it's expected to grow additional steps over time (say, closing a rewards account or sending a farewell communication), an explicit orchestrator holding all three steps and their compensations in one saga class is the safer long-term choice, since it keeps the entire process and its failure handling readable in one place as it grows.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response