Versioning mobile apps and apis

Versioning mobile apps and apis

Our internal workshop material

908a0c79fc96a06684fa7e2a523bde1b?s=128

Marek Kalnik

October 30, 2015
Tweet

Transcript

  1. VERSIONING MOBILE let your API and your APP evolve

  2. SEMVER Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version

    when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.
  3. THE APP versioning is not only about code

  4. None
  5. IN APP COMMUNICATION ➤ let the user know what version

    he’s using, so he may communicate it to you ➤ show application version in the application itself (it may include build #)
  6. KEEP VERSION NUMBER AUTOMATIC ➤ gulp-bump ➤ an after_prepare_hook (http://devgirl.org/2013/11/12/three-hooks-

    your-cordovaphonegap-project-needs/):
 var version = require(__dirname + ‘../../package.json’).version ➤ gulp-git ➤ add a git tag with -a (demo time)
  7. HOW TO HANDLE VERSIONS ➤ call URL’s with /{version_number} ?


    HTTP GET:
 https://api.bamlab.fr/v2/hello ➤ add api-version header
 HTTP GET:
 https://api.bamlab.fr/hello
 api-version: 2 ➤ add Accept header
 HTTP GET:
 https://api.bamlab.fr/hello
 Accept: application/vnd.bamlab.v2+json
  8. THE BACK it’s all about contract

  9. INTEGRATE THE VERSIONING IN ROUTING ➤ http://restify.com/#versionned-routes ➤ http://www.slideshare.net/shakefon/hapidays-2014/9? src=clipshare

    ➤ http://www.slideshare.net/shakefon/hapidays-2014/18? src=clipshare ➤ https://github.com/felipeleusin/hapi-negotiator
  10. NOTIFY OLD VERSIONS ➤ send a DEPRECATED header and expose

    a /version route ➤ send a 410 GONE response if you are removing a ressource 410 GONE AND IT WON’T BE COMING BACK
  11. VERSION YOUR DATA MODEL ➤ think about metadata ➤ add

    meta_version_number ➤ add a transformer to transform the model before exposing it to either version