Support multiple versions of the same API #202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This gives us the capability of making backwards-compatible updates
to a system in production, which in turn reduces the pressure to get
all of our APIs perfect before a launch.
If we want to remove a problematic endpoint or make backwards-incompatible
changes after release, we can release a new major version of the API with
those changes, and continue to serve the old version under a version prefix.
We can tell existing clients to point at the old version of the API, so they
can continue to run for some period of time before updating their software.
This also allows us to do hotfixes in production. For example, suppose there
is some bug which we cannot fix without a breaking change to the API. We can
add a new route with a
/hotfix
prefix or suffix. Only the affected clientsneed to change their code to use the hotfix endpoint. In the next major version,
the hotfix endpoint can replace the original.
Note that we can add new methods and make other backwards-compatible changes
with only a minor version bump, which can replace the existing API instead
of deploying a new version.
Closes #185