Going Beyond Versioning
Learn how to handle API changes by releasing a new, updated API in place of the old one.
We'll cover the following...
Principles of safe and effective API changes
Change is an inevitable part of APIs. It’s pretty unlikely that we’ll design, build, and deploy an API that’s just right and never needs to be updated. In fact, it’s a sign of a good API that people want to use it more often and come up with ways to make it even better. Popular APIs generate requests for changes. For that reason, we need to make changing APIs a regular part of our API practice.
The most common technique for handling API changes is to simply release a new, updated API in place of the old one. This is usually called versioning our API. It’s the most common technique, but it’s not the safest. If we’re not careful, we could release a new API that’s incompatible with existing uses. When this happens, we’re breaking current API clients, which is a bad thing.
Let’s take a look at a few principles of safe and effective API changes:
- First, do no harm.
- Fork the API.
- Know when to say no.