Two teams disagree: one wants synchronous REST calls between order and inventory, the other wants events. How do you resolve it as Principal Architect?
Short answer
Clarify the requirement each interaction serves. Use a synchronous call where the order flow needs an immediate, authoritative answer (reserve stock), and events for propagating facts to other consumers. Decide with explicit criteria (latency, coupling, consistency, failure modes), document the decision in an ADR, and keep both teams accountable for the agreed contract.
Detailed answer
- Facilitate with criteria: Does the caller need the answer to continue? What happens if the other service is down? What consistency is required? Who else needs the information?
- Likely outcome: Checkout calls inventory synchronously to reserve stock (needs an answer; uses timeout, circuit breaker and idempotency), or uses a saga with async commands if latency allows. Inventory publishes
StockChangedevents for search, analytics and notifications. - Write an ADR capturing options, decision and consequences.
- Define the contract: API spec + event schema, SLAs, error handling.
- Revisit triggers: e.g. if inventory availability SLO is not met, move to reservation via async saga.
What the interviewer expects
Technical judgment grounded in requirements, facilitation skills, and documentation rather than authority.
Common mistakes to avoid
Declaring one style universally better; deciding without understanding failure modes.