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

Support Parseq plan local cache to reduce fanout calls. #193

Open
mchen07 opened this issue Aug 10, 2018 · 6 comments
Open

Support Parseq plan local cache to reduce fanout calls. #193

mchen07 opened this issue Aug 10, 2018 · 6 comments

Comments

@mchen07
Copy link
Contributor

mchen07 commented Aug 10, 2018

Sometimes application make duplicate downstream calls when serving a request. One way is to make the Task sharable and pass it around, but it’s sometimes hard to refactor the code while maintaining code readability. It would be great that parseq can provide some cache capability to avoid duplicate calls.

Some idea may be: ParSeq can provide a plan-local cache <K, Task> where K is user-defined key and Task computes result. It would make sense to implement it on a ParSeq level because:

  1. ParSeq has a well defiled Plan life-cycle with hook when Plan completes (even after response has been sent to the client)
  2. Natural API for asynchronous computation which is a most common use case for a cache (we have seen similar feature requests for Rest.li request results)
@mchen07 mchen07 changed the title Enhance parseq-rest-client to support cache of rest.li requests to reduce fanout calls. Support Parseq plan local cache to reduce fanout calls. Aug 28, 2018
@hiteshsharma
Copy link
Contributor

This doesn't have to be a cache but could be a client supplied unique identifier, for each task, which Parseq can use before executing the plan and can de-dupe tasks. Clients should be responsible for providing unique identifier for non-identical tasks and unique ones for identical tasks. This will provide clients more control on the behaviour. Adding cache would also require client to have control of the cache parameters as it can affect the machine it's running on.

@mchen07
Copy link
Contributor Author

mchen07 commented Mar 19, 2019

@hiteshsharma I don't quite get your comments. In this proposed approach, ParSeq is maintaining the cache and ask for clients to provide cache key (as you indicated above unique identifier) K.

@hiteshsharma
Copy link
Contributor

@mchen07 later I realized a cache would anyways be required. Pardon my limited knowledge of Parseq. I'm really looking forward to this change. If this is being picked up I can also provide some help with some sub-tasks if needed.

@aliciatang
Copy link

Does it already exist in parseq-rest client already?

@mchen07
Copy link
Contributor Author

mchen07 commented Jan 6, 2021

No, I don't think ParSeq-rest-client has cache built in. @karthikbalasub @junchuanwang Do we have any plans to work on this in the near future?

@junchuanwang
Copy link
Contributor

No, I don't think ParSeq-rest-client has cache built in. @karthikbalasub @junchuanwang Do we have any plans to work on this in the near future?

@mchen07 We just discussed yesterday and from my understanding we are not going to work on this at least this quarter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants