Decision Mode

What is the Decision Mode?

When using Flagship, you will integrate either our APIs or our SDK in order to get some decisions for your visitor.

What we call a decision is selecting the correct set of flag keys & values that matches your visitor information (ID & context) with the use cases you set up inside the Flagship platform.

1858

Different modes of Decision

You can get a decision from Flagship in 3 different ways:

Decision API - Cloud

When calling our Cloud Decision API directly or using one of our SDKs, you rely on the API to do the whole decision-making.

You send it your visitor information & your environment ID, and the API does the heavy lifting of computing the use cases for which the targeting matches the visitor context, and sending back the use case information such as flag keys & values to you. You can then directly use those values to customize or experiment your visitor experience.

The Decision API also does the following additional work:

  • Tracking of the visitor context for report filtering purpose
  • Persisting visitor/variation assignment to make sure the visitor always sees the same variation in the case of experimentation

Decision API - Self Hosted

You can self-host the Decision API in your own infrastructure. The self-hosted version uses the same core decision engine than the cloud version, in order to guarantee decision consistency between the hosting modes.

You can use our docker image or the generated binary to host the API. Once you run it on your infrastructure, the API will regularly poll your environment configuration (use cases, panic mode, etc...).
When you call the API, it does the decision logic such as targeting and variation assignment.

The Decision API - Self Hosted still calls the Flagship data collection API to track visitor context for report filtering and to send hit tracking. But those calls are asynchronous, and will not block the main call for the Decision.

Thus, depending on your infrastructure, the API call could be nearly instantaneous.

You can see more information in the Github page of the project

Bucketing

The bucketing mode is offered with our SDKs. Contrary to the Decision API mode, when using Bucketing mode, the SDK actually does the heavy lifting.

The SDK will regularly poll what we call the Bucketing file (a JSON file containing your environment configurations such as use cases, panic mode, ...) and will compute the Decision logic such as targeting match with the visitor context, variation assignment, etc...

The SDK will also call the Flagship data collection API in order to track the visitor context for report filtering and sending the hits.

📘

info

Only SDKs can use the Bucketing mode because the Decision logic (targeting, variation assignments, caching, ...) is coded inside.

Learn more

Summary

ModeDecision executionFrequency of HTTP callsLocation HTTP calls
Decision APIOn the API1 call/visitor and context changeFlagship serverless API
Self Hosted APIOn the API1 call/visitor and context change- Your infrastructure
- Flagship data collection for tracking
BucketingSDK (visitor's device for client SDK or your server for server SDKs)Long polling
(1 call every 2 minutes)
- Flagship CDN
- Flagship data collection for tracking