System Design · Senior · Question 26 of 75
How do you deploy an API change without breaking clients on the old version?
- ✓Correct answer: Expand-and-contract: add, migrate, remove the old
- 2Roll out the API and frontend simultaneously, in the same second
- 3Ask users to refresh the page after the release
Explanation
Open tabs, mobile apps and caches live with old code. First the API supports both the old and new format, then clients migrate, and only then is the old one removed. The same approach applies to DB schema migrations.