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

feat: evaluate the user in the nodejs sdk to improve response latency #1260

Open
5 tasks done
cre8ivejp opened this issue Sep 25, 2024 · 0 comments
Open
5 tasks done
Assignees
Labels

Comments

@cre8ivejp
Copy link
Member

Go reference: #921

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

  • Create the evaluation package in the main repo
  • Implement API to get all flags and segment users per environment using the server-side API key
  • Implement cache in the Nodejs SDK (In-memory)
  • Implement the configuration to select to evaluate locally or remotely
  • Update documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants