...

/

The Process for Safely Deploying APIs

The Process for Safely Deploying APIs

Learn how to safely deploy an API.

Overview

When we get to the point where we plan to release our API updates, we have one more opportunity to check for backward-compatibility issues and confirm that we’ve done all we can to eliminate breakage for our API consumer clients. That means we need to figure out the best way to deploy our updates into production. To cover all these details, we’ll need to focus on a number of things:

  • Supporting reversibility
  • Using side-by-side deployments
  • Automatically routing traffic vs. waiting for clients
  • Overwriting old API releases

Supporting reversibility

Ironically, the first thing that we need to do when implementing our API update deployment system is make sure we can quickly and easily take our API out of production. In other words, we need to be able to back out of any API update and revert back to the way things were before we attempted the new deployment. This reversibility is our safety net in case something goes wrong during deployment.

Earlier, we learned the value of scripted deployments. We can consistently run (and rerun) our deployment script knowing that, each time we do, the process is the same. The same is true for reversing our deployment. As soon as we detect a problem with our install, we should be able to instantly undo our latest update.

Don’t Forget Your Data!

Deploying and reversing APIs can be complicated if our change involves adding new data properties to our storage model. If we deploy a new release that starts collecting new data properties and then need to reverse it, we might end up losing the added data we were collecting with the ...