Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Redis server-side local cache evaluation #128

Open
1 of 4 tasks
shawara opened this issue Nov 15, 2023 · 4 comments
Open
1 of 4 tasks

Add support for Redis server-side local cache evaluation #128

shawara opened this issue Nov 15, 2023 · 4 comments

Comments

@shawara
Copy link

shawara commented Nov 15, 2023

Is your feature request related to a problem?

For distributed systems each client is using a local cache which will increase the number of requests to fetch the same configs for X connected services

Describe the solution you'd like

Redis is an in-memory data structure store, used as a distributed, in-memory key–value database, cache and message broker, with optional durability.
We can use Redis caching for local evaluation instead of local memory and set the personal key token in only one service or worker to fetch the feature flags configs and save it on the Redis cache which is shared across all services.

Describe alternatives you've considered

Related sub-libraries

redis

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Additional context

Thank you for your feature request – we love each and every one!

@shawara shawara added the enhancement New feature or request label Nov 15, 2023
@benjackwhite
Copy link
Collaborator

I'm not sure that adding redis support is a good call tbh. It's another level of complexity to cover one database option which will overtime need updates, have requests for more different databases to be supported...

We could consider exposing some sort of API allowing you to control the local evaluation background refresher, so that you can set your own list of flags. Would that be helpful to the problem you are describing?

@PookMook
Copy link

PookMook commented Jan 25, 2024

we face the same problem as Shawara, the main problem not being the number of requests but more on the consistency between hosts if the polling ticks are not synced.
If we get a way to get the poller to save/read to/from an external store, that would solve our problems for sure.
That would save us from the Frankenstein solution we are starting to plan

@JCMais
Copy link

JCMais commented Feb 12, 2024

@PookMook did u guys end up implementing the Frankenstein solution?

@PookMook
Copy link

We didn't for the sake of time. If you're interested in what our solutions were I can share.

For the time being, we bailed out of posthog till there's an option to manipulate the poller. We have a bespoke solution (that we hoped to replace with posthog FF feature to let CX manage feature flag and feature releases on their own term), so we piggyback our of this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants