You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local evaluation hits our API hard (or can do) and it only does two things:
Checks the api token for access
Responds with all enabled flags
We don't need to be doing 1000s of DB calls all the time for this. I'm describing the normal "put a cache on it" catch all to public endpoints but I think we are in a really strong place to do this now
Describe the solution you'd like
This feels simple enough that we could move this to our RemoteConfig approach.
Have the RemoteConfig model be responsible for listening to Flag changes, serializing the local flag payload and wriitng it to the "store" (redis currently)
Write to the store directly or indirectly a hash of all API keys that have access to this resource for quick lookup
Modify the endpoint to do this quick lookup rather than our standard, DB heavy checks, returning 404 or 401 by default if not found
This still means django is being hit but with almost no load on our DB (it only needs the very available redis).
I think we could even discuss going one step further... Make a new rust service that is a simple "public-api-gateway". It can then do this redis lookup for us, leaving django as our nice, easy to manage business-logic application but having a protective layer of rust for handling the hard-to-scale high-throughput API side that django fails at.
I'd also advocate for nodejs as a good option here too but given we have a lot of ready-to-go code via capture, it likely wouldn't be super hard to get something up and running.
Additional context
Finally - everything I've said is equally true for surveys 🤷
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
The text was updated successfully, but these errors were encountered:
Feature request
Is your feature request related to a problem?
Local evaluation hits our API hard (or can do) and it only does two things:
We don't need to be doing 1000s of DB calls all the time for this. I'm describing the normal "put a cache on it" catch all to public endpoints but I think we are in a really strong place to do this now
Describe the solution you'd like
This feels simple enough that we could move this to our RemoteConfig approach.
This still means django is being hit but with almost no load on our DB (it only needs the very available redis).
I think we could even discuss going one step further... Make a new rust service that is a simple "public-api-gateway". It can then do this redis lookup for us, leaving django as our nice, easy to manage business-logic application but having a protective layer of rust for handling the hard-to-scale high-throughput API side that django fails at.
I'd also advocate for nodejs as a good option here too but given we have a lot of ready-to-go code via
capture
, it likely wouldn't be super hard to get something up and running.Additional context
Finally - everything I've said is equally true for surveys 🤷
Debug info
The text was updated successfully, but these errors were encountered: