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

Cache improvement: ListFlags #935

Closed
AyWa opened this issue Jul 12, 2022 · 4 comments
Closed

Cache improvement: ListFlags #935

AyWa opened this issue Jul 12, 2022 · 4 comments
Assignees
Labels
go md Not too big, not too small

Comments

@AyWa
Copy link

AyWa commented Jul 12, 2022

Describe the bug

  • ListFlags should be cache by flipt when cache is enable. Right now it will always call the storage
  • When a key is not in storage, it seems we defer to the underlying storage, so if there is a lot of req/s, we might call the db multiple times. I would suggest that we try to call the db only once

Version Info

main branch

@markphelps
Copy link
Collaborator

markphelps commented Jul 12, 2022

Thanks @AyWa ! Im actually working on improving caching currently as well as introducing Redis support for cache. I'll take this on as part of that work after that work is complete #633.

My only concern with caching the List Flags response would be the number of flags that could potentially be returned which could cause the cache to 'overflow'. Perhaps setting a default + max batch size for the list flags request would help solve this? I just realized we arent enforcing a default or max limit for listing flags today 🙈

@AyWa
Copy link
Author

AyWa commented Jul 13, 2022

@markphelps Sounds good !

My only concern with caching the List Flags response would be the number of flags that could potentially be returned which could cause the cache to 'overflow'.

Yeah thats true that it could be a problem, I agree that setting a default + max batch size might help to ensure we dont overflow the cache !

@erka
Copy link
Collaborator

erka commented Jan 8, 2024

@markphelps do you actually want do to this? I believe ListFlags probably isn't called a lot of times(web ui/import/export). Web UI should cache the list for some time, export/import one time operation. Could you guide me please where I have blind spot?

@markphelps
Copy link
Collaborator

Yeah I think I agree. Going to close this for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go md Not too big, not too small
Projects
None yet
Development

No branches or pull requests

3 participants