Background
In order to target users based on their traits (aka attributes), Flagbase will need to maintain an index of these traits for fast lookup. We will call this index the “trait catalogue”
Solution
Upon evaluating a client-side feature flag, the evaluating user’s trait set will be pushed onto a queue. Processing of this queue (managed by trait-catalogue-service
) will consist of the following steps:
Ensure key length is appropriate (i.e. in order to prevent overflow attacks, which may halt processing)
Normalise keys (i.e. convert camalCase values into snake_case)
Insert normalized key into
traits
table with the key indexed.