💸 decrease polling frequency of getGroupPinboardIds
and getItemCounts
from 5s to 15s
#304
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…as they're quite expensive (and also a bit annoying in the Network tab of the Dev Tools when debugging composer, grid, workflow etc.)
This is hopefully a temporary measure that I'd like to replace with GraphQL subscriptions somehow, so they're realtime like everything else - but this is not straight forward given it requires a DB query to determine who's impacted by a change in a group mention, which can't be done directly in the mutation (so would need to be triggered as follow-up task... i.e. complexity).
Detail
EU-GraphQLInvocation
makes up the majority of the cost of pinboard...... and using enhanced metrics in AppSync we can see that
getGroupPinboardIds
andgetItemCounts
are the two big hitters (making up 85% and 12% respectively) , since they're polled every 5s even when pinboard is collapsed, so essentially while every user has composer, grid, MAM or workflow open...... so by decreasing the polling frequency from 5s to 15s, we should expect to see AppSync cost fall from approx $15 a day to $5. So whilst not efficient as it could be with a subscription-based approach, it does represent savings of $3,650 per year... which can start the moment this PR is merged 🙏