Software Architecture / Foundations: promises, structure, and ownership / Lesson 7
Analyze failure modes in user flows
Trace a user flow and define dependency failure impact, response, and verification.
On this page
Lesson goals
- Identify failure modes and their user and data impact.
- Test a bounded response and record risks and ownership.
Choose a user flow
Failure analysis starts with a specific user outcome rather than an inventory of components alone. Choose a simple synthetic reservation flow and identify its client, application, data owner, and external dependencies. Record what success means and who owns the outcome. This boundary keeps the analysis focused: a component can be healthy while the user’s complete operation still fails because a dependency or contract is unavailable.
Identify failure modes
For each step, ask what happens if a dependency is unavailable, slow, returns an error, or returns an unexpected result. The example table is a hypothesis, not evidence of an incident. Include the affected user and data state, not only the failing component. Avoid assuming a timeout means no work occurred: a remote operation may have completed before its response was lost.
flow: create reservation
failure: dependency response times out
question: did the reservation commit?
user outcome: pending until status is known
The scenario illustrates the need to check state and does not claim an incident occurred.
Describe impact and detection
Describe the scope and duration of impact in terms the service owner can verify. Specify how the team detects the failure and distinguishes it from missing telemetry. A metric showing a dependency error is useful, but an outcome measured at the user boundary answers whether reservations actually succeed. Record assumptions and uncertainty instead of assigning precise probabilities without evidence.
Choose a bounded response
For each important failure, define a response, owner, and safe limit. A response might reject new reservations, retry a known safe operation, or show a pending state while work completes. The choice depends on the business invariant and must not promise success before it is established. Include a recovery and rollback path, and check whether the response adds load to a failing dependency.
Test the claim
Use a disposable test environment and synthetic data to simulate one failure at a time. Compare the observed user result and durable data state with the documented expectation, then verify recovery. The checklist below defines evidence to collect; it does not report a test result. Revisit the analysis when the flow or dependency changes, and assign unresolved risks to an owner rather than treating the table as certification.
inject: one dependency timeout in lab
observe: user response and durable state
verify: recovery and no duplicate reservation
This is an unexecuted lab plan; the expected result depends on the system contract.
Common errors and fixes
Treating a timeout as proof no commit occurred
- Why it happens
- Work may complete while the response is lost.
- How to fix it
- Inspect durable status before repeating the operation.
- Prevent it next time
- Design queryable status and safe retry behavior.
Measuring component health alone
- Why it happens
- The user outcome was not defined.
- How to fix it
- Verify the flow and data at the user boundary.
- Prevent it next time
- Tie signals to a clear service objective.
Testing failure without recovery
- Why it happens
- The later outcome and owner were not specified.
- How to fix it
- Verify return to expected state and assign remaining risks.
- Prevent it next time
- Include recovery and ownership in every scenario.
2 practice exercises
1. Reservation creation timed out. Should it immediately be created again?
Show worked solution
Not without a safe retry contract. Check the original operation’s state because it may have committed before the response was lost.
2. Components appear healthy but reservation fails. What do you measure?
Show worked solution
Trace the user outcome across dependencies and reservation data, checking connectivity, contracts, and telemetry state for the same window.
Key takeaways
- Start with a specific user and data outcome.
- Test failure and recovery and assign risk ownership.