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

request coalescing / query deduplication on subgraph requests #264

Closed
Geal opened this issue Dec 13, 2021 · 1 comment
Closed

request coalescing / query deduplication on subgraph requests #264

Geal opened this issue Dec 13, 2021 · 1 comment
Assignees

Comments

@Geal
Copy link
Contributor

Geal commented Dec 13, 2021

Following up on the work about caching in #174 and #235. The cache supports request coalescing (also know as query deduplication): if a value is not in the cache, we do the underlying query, but if there is already a running query for it, we should wait for it to complete instead of executing the query multiple times in parallel. That way we get the result faster and reduce the amount of work.

I think this feature would make a lot of sense on subgraph queries, to reduce traffic to backend servers, and would unlock some of the benefits of caching (with a query taking 40ms, it would set an upper limit of 25rps on the subgraph instead of one subgraph query per client query) without tackling the issues of cache invalidation. And that would be compatible with caching once we get there.

Risk: we are not sure yet if the mutex design we use is safe against deadlocks, so I'll work on modeling and testing it so we can reuse it

@Geal
Copy link
Contributor Author

Geal commented Feb 16, 2022

Implemented by #285

@Geal Geal closed this as completed Feb 16, 2022
tinnou pushed a commit to Netflix-Skunkworks/router that referenced this issue Oct 16, 2023
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: apollo-bot2 <apollo-bot2@users.noreply.github.com>
Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
lennyburdette pushed a commit that referenced this issue Dec 5, 2023
Tryouts with a two steps execution approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants