|
|
|
|
|
by chipdart
633 days ago
|
|
> Feature flags can be checked dozens of times per request and often need the kind of queries (user is a member of group A and has an IP located in country B) which could be well served by a local SQLite - and feature flags have a tolerance for updates taking a few seconds (or longer) to roll out. This doesn't sound right. A feature flag only requires checking if a request comes from a user that is in a specific feature group. This is a single key:value check. The business logic lies in assigning a user to a specific feature group, which the simplest way means pre assigning the user and in the most complex cases takes place at app start/first request to dynamically control dialups. Either way, it's a single key: value check where the key is user ID+feature ID, or session ID + feature ID. I mean, I guess you can send a boat load of data to perform the same complex query over and over again. I suppose. But you need to not have invested any thought onto the issue and insisted in making things very hard for you, QAs, and users too. I mean, read your own description: why are you making the exact same complex query over and over and over again, multiple times in the same request? At most, do it once, cache the result, and from therein just do a key:value check. You can use sqlite for that if you'd like. |
|
This meant you could roll features out to:
- Specific user IDs
- Every user ID in a specific group
- Every object owned by a specific user ID (feature flags might apply to nested objects in the system)
- Requests from IP addresses in certain countries
- Requests served by specific website TLDs
- Users who are paid members of a specific plan
- etc etc etc
It was an enormously complicated system, that had evolved over 5-10 years.
Not saying that level of complexity is recommended, but that's what we had.
Looks like I gave a talk about this back in 2014: https://speakerdeck.com/simon/feature-flags