Home Page

Open Source
Application Iteration Management Middleware

Instrument hundreds of deployment flags daily.

Run hundreds of experiments at the same time.

Variant offers a unique approach to instrumenting online experiments and feature flags. Architected as client/server middleware, Variant is tightly integrated with the host application’s runtime and operational data. Variant is particularly attractive to distributed and cloud-native host applications.

A Simple Example

Server Side

Here’s how easy it is to instrument a simple pricing experiment with Variant. Suppose your existing application offers two pricing tiers, Free and Pro, and you would like to experiment with a three-tier pricing by offering an additional ProPlus tier. Let’s further suppose that the pages where this experiment is relevant are Plans and Upgrade. All these semantics are conveniently encapsulated by the Variant variation schema on the right. Simply drop this schema in the server’s /schemata directory and Variant is ready to send one in 500 sessions into the experiment.

    'coment':'Example Variant schema'
  'states':[{'name':'plansPage'}, {'name':'upgradePage'}],
      'onStates':[{'stateRef':'plansPage'}, {'stateRef':'upgradePage'}]

Client Side

The application side instrumentation code is similarly simple. Start with creating Variant client and connecting to the above variation schema on the server. When user navigates to one of the instrumented pages, e.g. the Plans page, obtain Variant session and target it for this page. Object liveExperience will contain the information you need to route the user into the appropriate code path.

ServletVariantClient client = ServletVariantClient.build();
Connection VariantConnection = client.connectTo("variant://localhost:5377/example");

// ... Once on the Plans page
Session variantSsn = variantConnection.getOrCreateSession(httpRequest);

Schema schema = variantSsn.getSchema();

State plansPage = schema.getState("plansPage").getOrThrow(
   new RuntimeException("Page 'Plans' does not exist"));

Variation pricingExperiment = schema.getState("PricingExperiment").getOrThrow(
   new RuntimeException("Variation 'PricingExperiment' does not exist"));

StateRequest req = variantSsn.targetForState(plansPage);
Experience liveExperience = req.getLiveExperience(pricingExperiment).getOrThrow(
   new RuntimeException("No live experiences in variation 'PricingExperiment'"));

Support for Play applications is coming soon.
Support for JavaScript is coming soon.


0.10.2 8 October, 2019



  • Multi-threaded event writer.
  • Complete transition to Akka actors and Akka HTML


  • No changes