-
Notifications
You must be signed in to change notification settings - Fork 113
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
chore(rfc): operation cache warmer #1115
base: main
Are you sure you want to change the base?
Conversation
rfc/distributed-operation-cache.md
Outdated
The User can push individual operations to the distributed operation cache by using the CLI: | ||
|
||
```bash | ||
wgc router cache add -g mygraph operations.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be under the namespace "router"?
At which level do we apply cache warming?
Org? Namespace? Graph? Router?
As an alternative, you could consider creating a "cache-warming-bucket", which you can then use to add operations, and which can be used in the router config, e.g.:
version: "1"
cache_warmup:
enabled: true
interval: 5m
bucket: myBucket
I'm not sure though if this is the right direction.
The cache warming bucket is somewhat closely related to a Graph because the containing operations need to be compatible with the client schema of the graph.
rfc/distributed-operation-cache.md
Outdated
] | ||
``` | ||
|
||
The cli command is idempotent and always updates the cache with the latest operations. This doesn't trigger the computation of the Top-N operations which is done periodically by the Cosmo Platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another aspect to think about is pre-compiling operation plans.
We could make plans serializable, generate and serialize them at composition time.
Once the router wants to "load" them, it doesn't have to plan everything but can load the plan much faster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for drafting this proposal, it looks great, can't wait to see it live!
Left a few questions I had during reading.
The User can push individual operations to the operation cache by using the CLI: | ||
|
||
```bash | ||
wgc federated-graph operation-cache add --graph mygraph --file operations.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about manual cache invalidation.
What will happen in the following scenario:
First, we run:
wgc federated-graph operation-cache add --graph mygraph --file operationA.json
Then we run:
wgc federated-graph operation-cache add --graph mygraph --file operationB.json
What will we have in the cache after the second operation? Will it be just Operation B or both Operation A and Operation B?
Curious, because if it is both Operation A and Operation B, the cache eventually will be filled with the manual operation and there will not be space for automatic operations unless we can invalidate it explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right. Both operations will be in the "batch". This is the part where a customer can manage the cache themself and is responsible of it. At some point, we could also introduce a percentage limit about how much space can be reserved for manual pushed operations. In the first version, we want to keep it simple.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Motivation and Context
TODO