-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: evaluate the user in the go sdk to improve response latency #921
Labels
Comments
This was referenced Apr 15, 2024
cre8ivejp
changed the title
feat: evaluate the user in the sdk instead of the backend
feat: evaluate the user in the go sdk to improve response latency
Apr 15, 2024
This was referenced Apr 15, 2024
This was referenced May 8, 2024
This was referenced May 17, 2024
This was referenced May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The current architecture when the get variation interface is called. It requests the evaluation directly from the server.
This approach is more straightforward but may introduce latency. Also, this could lead to infra-cost issues because it could evaluate the same user many times in a short time, even if the flag didn't change.
We should consider implementing the evaluation logic in the SDK to implement a cache similar to the client SDK.
This would improve the latency issues and drastically reduce the requests to the server, reducing the infra-cost.
I was thinking of creating a new common repository for the evaluation and proto files, but it would be better if we kept this as a mono repo for this case. We can move it to another repository in the future if needed.
TODO
API Gateway
It will evaluate the user from the evaluation module. There are no changes in the evaluation code.
API Key
We will implement a new key type, which will have access to all the flags and segment users per environment.
I will add a new column called
key_type
in theapi_key
table to check what the key can retrieve.SDK cache
The cacher will cache all the flags and segment users per environment in memory.
It will poll the latest data from the Bucketeer server and override the current in-memory data every 30 seconds.
This implementation will be similar to the other client SDKs.
SDK get variation interface
We won't change the current interfaces. The changes will be made internally to evaluate the user in the SDK, just like the Bucketeer app does on the server side.
The text was updated successfully, but these errors were encountered: