This document describes the basic concepts of Flipt.
Another common use-case of Namespaces is to separate Flipt data by internal team or organization.
Namespaces can be managed within the 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.
There are two types of flags:
colorscheme
that determines which main colors your users see when they login to your
application, then possible variants could include dark, light or auto.
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.
new-users.
Match Type of either:
new-users segment, you may want
to check their finished_onboarding property.
All constraints have a property, type, operator and optionally a value.
true or false2020-01-01 or 2020-01-01T00:00:00Z (RFC3339)
IF 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 dark
for all entities in the new-users segment. This would be configured like so:
Rules are evaluated in order per their rank from 1-N. The first rule that
matches wins. Once created, rules can be re-ordered to change how they’re
evaluated.
dark variant to your new-users
segment, you want to show dark to 10% of new-users, light to 30%, and auto
to the remaining 60%. You would accomplish this using rules with distributions:
The ability to manage distributions, as illustrated in the image above, is an extremely powerful feature of Flipt that can help you seamlessly deploy new features of your applications to your users while also limiting the reach of potential bugs.
true or false based on the flags enabled property. Rollouts allow you to potentially change this value at request time.
Rollouts are a sequence of conditions which when one is matched for a request context, overrides the flag’s enabled property.
Current rollout types include:
true or false for a given percentage of entities.true or false if an entity matches a given segment.
Rollouts work similar to Rules in that they’re evaluated in order per their rank from 1-N. The first rollout that matches wins. Once created, rollouts can be re-ordered to change how they’re evaluated.
new-user, and which color
(dark, auto, or light) that they should see for their main color scheme.
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.