...
[3] Non versioned solution: Running two separate applications with services communicating to the same dataset and having an upstream device implement url routing is identical to us implementing an "evergreen" url
Feature Request: Multiple Application Versions with Rollback capabilities. Customers would like the ability to throttle requests between multiple versions of an application and service.
Requirements
- User can deploy a new version of an Application while keeping the old one.
- User can control the lifecycle of a Program from a particular Application version.
- The same Service program from different Application versions can be running concurrently.
- User can control the routing of incoming Service requests to different Service versions by percentage.
- User can make Service requests to a version specific endpoint.
Design
- Introduce versioning for Application
- Application is created from Artifact, which already has versioning.
- Upon Application creation, increment the Application version by one.
- Introduce version specific REST endpoint for Application
- Path prefix as
<base-url>/namespaces/<namespace>/apps/<app-id>/versions/<app-version>
- Most of the endpoints in http://docs.cdap.io/cdap/current/en/reference-manual/http-restful-api/lifecycle.html will have a version specific variant.
- Except the one for create Application.
- Existing non-version specific endpoints are aliases to the latest Application version.
- Path prefix as
- The same Service of different Application versions can be started and running concurrently.
- All of them will publish under the same service name in ZK.
- The Application version will be stored inside the ephemeral node created by that particular Service version.
- Introduce version specific REST endpoint for Service routing
- Request path is
<base-url>/namespaces/<namespace>/apps/<app-id>/versions/<app-version>/services/<service-id>/methods/<endpoint-path>
- Request path is
- Router is aware of the Service version during routing
- For version specific endpoints, router will only route to those who have matching version based on version information stored in the ZK node.
- For non-version specific endpoints, router can optionally take a version distribution configuration.
- The configuration is stored in a ZK node
- New REST API exposes from app-fabric to set the distributed for a given service
- Router will watch for changes in that node to get hold of updates in distribution
- Router will route requests based on the distributed configuration
- If the configuration is missing, it will just route randomly to all available Service containers
- The configuration is stored in a ZK node