Checking multiple Flipper-flags at once #724
-
Hello! We have a use-case where we need to serialize the Flipper-state for one record for a limited number of flags. Would it be possible to have the ability to pass multiple keys at once? We are using the ActiveRecord-adapter. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
bCan you explain more about what the concern is with calling Flipper in a loop? If you are using Rails and the default setup, all calls to Flipper are preloaded and memoized, so there is no significant overhead for repeated calls and only one database query.
You would just have to collect these manually using Here's more info on memoization: https://www.flippercloud.io/docs/optimization |
Beta Was this translation helpful? Give feedback.
Flipper is configured to preload and memorize all feature data before each request. So whether you check zero feature flags, or 1000 with multiple actors, it only makes one query to the database. The preloading will likely need tuned on large apps with a lot of features and actors to only selectively load features that are commonly used.