• 510.205.3525

  • hello at getvariant.com

Variant Experiment Server

Variant is a ground-breaking, instrumentation-first platform for creation and management of A/B tests and feature flags at scale. We are the only experimentation solution that enables complete decoupling of experience implementation from its instrumentation as an experiment or a feature flag. The implementation of new application code paths will always be the application programmer’s job. But the job of instrumenting these code paths as experiments or feature flags should not be.

Variant brings to the table a sophisticated domain model and a rich grammar informed by it, which allows you to impart to Variant server the complete understanding of all experiments on your host application and their interplay. This knowledge enables Variant server to do all the hard work of figuring out your users’ qualification and targeting without a single line of code.

Quick Example

For a practical example, consider the Bookworms Java Demo Application, an online bookstore. The experiment schema below represents a detailed descriptions the two experiments FreeShippingExp and ReputationGG instrumented on three pages Home, BookDetails and Checkout.

name: bookworms
description: Variant experiment schema for the Bookworms demo application.
flusher:
  class: com.variant.spi.stdlib.flush.TraceEventFlusherCsv

states:
  - name: Home
  - name: BookDetails
  - name: Checkout

experiments:

  # Testing offers of free shipping to inactive customers with multiple minimal
  # order thresholds.
  - name: FreeShippingExp
    experiences:
      - name: Nada
        isControl: true
      - name: On50
        parameters:
          threshold: "50"
      - name: On100
        parameters:
          threshold: "100"
    onStates:
      - state: Home
      - state: BookDetails
      - state: Checkout
    timeToLive:
      qualification: state
      targeting: experiment
    hooks:
      # Only qualify unengaged users.
      - class: com.variant.demo.bookworms.spi.FreeShippingExpQualificationHook

  # Feature Flag gating access to the reputation feature on the book details
  # and the checkout pages.
  - name: ReputationFF
    experiences:
      - name: WithReputation
    onStates:
      - state: BookDetails
      - state: Checkout
    hooks:
      # Only allow the user "WithReputation" into the feature.
      - class: com.variant.demo.bookworms.spi.ReputationFFQualificationHook

The FreeShippingExp experiment tests the hypothesis that offering free shipping to inactive customers will generate more sales. It is instrumented on the Home, BookDetails, and Checkout pages (lines 25-28). The control experience Nada represents the existing codepath with no offer. The two treatments On50 and On100 implement the free shipping offers for minimum purchase of $50 and $100 respectively.

The qualification logic of whether a user is inactive is implemented by the class FreeShippingExpQualificationHook (line 34). In real life this hook would likely read the operational database for the up-to-date information about the user’s purchase history. The time-to-live (TTL) section (lines 29 – 31) determines how long a user’s qualification and targeting remains in effect with respect to the FreeShippingExp experiment.

The targeting TTL value experiment (line 31) means that once targeted, a particular recognized user will see the same experience on any return visit, so long as the experiment itself is defined. Targeting stability is a common requirement in real-life experiments and Variant guarantees it even if another experience is added to the experiment.

Concurrently with the free shipping experiment, the reputation feature flag ReputationFF gates access to the brand new code path which adds a seller’s reputation on the BookDetails and Checkout pages. The traffic into the reputation feature is qualified by the ReputationFFQualificationHook. In real life it would likely qualify only a select set of users.

Finally, the TraceEventFlusherCsv flusher (line 4) defines the trace event logging destination — in this case a local CSV file. The CSV flusher and many others are available out of the box, as part of the Variant SPI standard library, included in the server distribution.