Friday 19 May 2017

Versioning Azure Mobile App API (Node.js)

I am currently developing the last batch of changes (hopefully) for a software system that includes the following pieces:

  1. Azure SQL Server database backend.
  2. Azure Mobile App API middleware.
  3. iOS/Android clients.

I'd like to know what is the best way to version #2 such that I can keep its API in sync with #3. That is, I'd like v1.0 of the iOS client to only be able to call v1.0 of the Azure API. When I upgrade to v2.0 of the Azure API (trying to keep the same API method names), I'd like v1.0 of the iOS client to still access the API v1.0 and v2.0 of the iOS client to access API v2.0.

Logically, it seems like you could replicate v1.0 into a new v2.0 Mobile App. That has the advantage of keeping everything separate and not needing to change API method names, just the base URL of the Azure SDK's client. But that's obviously practically pretty untenable, especially if you need to service a high customer load. That could lead to some pretty high charges.

I already subfolder my API files, and it doesn't appear that makes any difference to how I need to call them. If I have a ReallyCoolMethod.js file, it doesn't seem to matter where it lives, as long as it is a descendant of the api folder in the root. I'd like to avoid having something like this:

  • v1.0: ReallyCoolMethod.js
  • v2.0: ReallyCoolMethod_v2.js

But is that the best way? Is there a way to do the following?

- root
   |-- api
        |-- v1
        |    |-- ReallyCoolMethod.js
        |    
        |-- v2
             |-- ReallyCoolMethod.js

If so, how could I route the call from InvokeAPI to the correct version?

Note: I am not asking about the difference between Azure Mobile Services and Azure Mobile Apps. I know there are some versioning issues involved there, but that is unrelated to my question. My question is about a single Azure Mobile App and different versions of my API within that single app container.



via mbm29414

No comments:

Post a Comment