API / Microservices Design Patterns Interview Questions
What is the Parallel Run pattern and how does it reduce migration risk?
The Parallel Run pattern runs an old and a new implementation simultaneously against the same live production input, comparing their outputs to verify correctness before committing to the new system. The legacy system's response is always returned to the caller — it remains the source of truth. The new system's response is captured asynchronously, compared in the background, and any discrepancies are surfaced to developers.
The flow for each production request:
- An intercepting component (a routing layer, the calling service, or a library) fans the request out to both the legacy system and the new service.
- The legacy system's response is returned to the caller immediately — no user impact if the new service is slow or fails.
- The new service's response is captured asynchronously and compared with the legacy response field-by-field.
- Mismatches are logged with enough context for developers to reproduce and diagnose the discrepancy.
- When the mismatch rate reaches zero over a sustained period, the new service takes over as authoritative and the legacy path is removed.
GitHub's open-source Scientist library (Ruby) popularised this technique under the name "controlled experiments". The pattern is particularly valuable for stateful, business-critical calculations — pricing engines, financial reconciliations, eligibility rules — where unit tests cannot fully cover the diversity of real production inputs.
The key safety guarantee: the new service can produce wrong answers, time out, or crash during the parallel phase, and no user is ever affected. This makes it possible to run experiments on 100% of production traffic while accepting zero user-facing risk from the new implementation.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
