This document describes the basic concepts of Flipt v2.
default
along with the default
namespace.
Settings
section of the Flipt UI:
New Contact Page
could be used to determine whether
or not a given user sees the latest version of a ‘Contact Us’ page that you are
working on when they visit your homepage.
Flags can be used as simple on/off toggles or with variants and rules to support
more elaborate use cases.
Proceed to Checkout Color
that determines which color your users see when they proceed to checkout, then possible variants could include blue
, red
or green
.
true
or false
respectively. Boolean flags work well for simple use cases where you don’t need to return multiple variants.
Boolean flags can be configured with rollout rules to determine which entities receive true
or false
for a given flag.
String
, Number
, Boolean
Array
, Object
beta-users
.
Match Type
of either:
beta-users
segment, you may want
to check their finished_onboarding
property.
true
or false
2020-01-01
or 2020-01-01T00:00:00Z
(RFC3339)entityId
that was sent in the body of the Variant
or Boolean
requestIF IN segment THEN RETURN variant_a
or they can be
richer by using distribution logic to roll out features on a percentage basis.
Continuing our previous example, we may want to return the flag variant green
for all entities in the beta-users
segment. This would be configured like so:
green
variant to your beta-users
segment, you want to show green
to 10% of beta-users
, blue
to 30%, and red
to the remaining 60%. You would accomplish this using rules with distributions:
true
or false
for a given percentage of entities.true
or false
if an entity matches a given segment.beta-user
, and which color
(green
, blue
, or red
) that they should see for their checkout color.
entity
in the Flipt
ecosystem. More often than not this will be a user, but we didn’t want to make
any assumptions about how your application works, which is why entity
was chosen.
entityId
and it’s a
simple string. It’s up to you what that entityId
is.
It could be a:
context
is a simple map of key-value pairs where the key is the
property to match against all constraints, and the value is what’s compared.
flagKey
, entityID
and context
. This is what allows Flipt to return the same variant every time (also sometimes referred to as stickiness).
flagKey
and entityID
and concatenates them together to
form a string that looks like flagKey:entityID
. This is called the key.A
and B
.
If distribution A
has a 30% ‘rollout’, then it would ‘take up’ buckets 0‐299 (out of the 1000 buckets). Distribution B
would take up the remaining buckets 300‐999.
The flagKey/entityID
hashed value is a 32bit integer on which Flipt performs a modulo operation (% 1000) so that it ‘s guaranteed to return a number between 0‐999.
The result of the modulo operation is then used to determine which distribution to return via the bucket mapping. If the result is between 0‐299, then distribution A
is returned, otherwise distribution B
is returned.