Decision
Move orders to a queue before the sale season
Context
Checkout writes the order, reserves stock, sends the email and raises the invoice in one request. Last sale, one slow call held the whole request open, and checkout timed out with it.
Options
We recommend
Option B. Payment stays in the request; stock, email and invoicing move to a queue with retries. Look at C again after the season, with real numbers from this one.
What we would not do
- Rewrite checkout in the six weeks before the sale.
- Buy a bigger database to hide a slow payment call.
- Adopt a queue product nobody on the team has run.