0 Concepts: Rings
Pratik Bhattacharya редактировал(а) эту страницу 2021-12-18 02:17:48 +05:30

Rings

The new feature is gradually exposed to users. Initially, the feature is exposed to a small set of users (let's call them Power Users). Once you are satisfied with the results, you add more users to your Power Users and observe their behaviour. Hence you will have layers of user subsets, with each set being the superset of the preview set.

Rings are a predefined set of conditions used to identify the different layers of the subset of users for a feature toggle.

In attribute-based rings, the users are chosen based on attributes like Location, Subscriptions, etc. We can choose other attributes in an enterprise application such as Division, Job Title, Specialization, etc. If we take Location as an example a sample ring distribution would be India -> Asia -> Asia + USA -> Asia + USA + Europe -> Global Rollout. So you expose the feature to all users in India, followed by users in Asia and so on.

Rings Concept

Implementation

Rings are implemented in Feature Flag using the Stage Name and Stage ID attributes. Stage Name represents the name of the Ring, and Stage ID is an unique incremental ID for each stage.

Theoretically speaking, a Feature Flag can have multiple Rings and each Ring can have multiple filters. StageID determines the Ring for that filter. Hence, the filter are grouped by the Stage ID. The IsActve attribute is used for determining which Ring is active. So if a feature flag has 2 filters for Ring 1 (with Stage ID = 1), then all the filters which StageId as 1 will have IsActive set to true.

Example - Feature flag with 2 Rings (1 & 2) and each ring has a UserUPN filter. Assume only that Ring 1 is active.

{
    "name": "Scenario-5-Multi-Ring",
    "description": "Mail must belong to any of the configured value",
    "enabled": false,
    "environment": "dev",
    "conditions": {
        "client_filters": [
            {
                "name": "UserUPN",
                "parameters": {
                    "operator": "In",
                    "value": "tonystark@gmail.com,jarvis@gmail.com,peter.parker@outlook.com",
                    "isActive": "true",
                    "stageId": "1",
                    "stageName": "Ring 1",
                    "flightContextKey": "UserUPN"
                }
            },
            {
                "name": "UserUPN",
                "parameters": {
                    "operator": "In",
                    "value": "tonystark@gmail.com,jarvis@gmail.com,peter.parker@outlook.com,wanda@vision.com,pepper.potts@gmail.com,thor@asgard.com",
                    "isActive": "false",
                    "stageId": "2",
                    "stageName": "Ring 2",
                    "flightContextKey": "UserUPN"
                }
            }
        ]
    }
}

See the below scenarios for more example

  1. Feature Flag with 2 Rings
  2. Feature Flag with 2 Rings with each ring having multiple filters