News for hackers. Stuff that matters.
Re:SQLedge: Replicate Postgres to SQLite on the Edge by vasco on Wednesday August 09, 2023 @11:42AM (#37064382)
> May I ask why the flags are checked that frequently? Couldn't they be cached for at least a minute?

Not in that project but feature flags don't have to be all or nothing. You can apply flags to specific cohorts of your users for example, so if you have a large user base, even if you cache them per-user, it still translates into many checks a second for large systems.

Re:SQLedge: Replicate Postgres to SQLite on the Edge by mikepurvis on Wednesday August 09, 2023 @01:26PM (#37065935)
I guess the cost of doing it precisely isn't terribly high, but if the majority of the flags were "off" (eg, subsets of users being opted into a beta or something), I wonder if you cut a bunch of the queries by sending down a bloom filter.

So basically you check the filter first, and if that says the feature is enabled, only then do you actually ask the real DB.

Re:SQLedge: Replicate Postgres to SQLite on the Edge by kiitos on Thursday August 10, 2023 @07:11PM (#37082923)
Checking a feature flag for a given cohort/user/demographic/etc. should always be a memory read, not a syscall. (You can't have syscalls in a hot loop!) That means feature flags will always be cached in each application instance from their source of truth. And that means you would never query the source of truth directly from the application, regardless of any property of the flag or its users.