All things Shopify and commerce
I'm aiming to create a dynamic product filtering system on my store that prioritizes products based on real-time inventory levels across multiple warehouses. I'm considering using GraphQL to fetch this real-time data.
Solved! Go to the solution
This is an accepted solution.
@Ryan_Coremeta wrote:Are there performance or caching concerns I should be aware of when fetching real-time inventory data?
Rate limits during flash sales or high order bursts, you'll want to calculate if the store has a chance of redlining and choking on api limits. Doubly so if your polling for inventory changes instead of webhooks and then also mutating inventory or metafields for the filtering.
If limits can be hit figure and not on shopify Plus calculate the cost of just using Plus for higher rate limits, or also build remediation to wait for the rate limit quota to refill.
Or a custom velocity algorithm to hit the api at little as possible with accumulated values; e.g. 100stock to 0stock in 60 seconds should not be 100 separate requests in increments of 1, instead make it 5 requests 90, 50, 25, 5, 0 and account for overshooting early to reset inventory to be back in stock see the new inventory states https://changelog.shopify.com/posts/mark-inventory-as-unavailable .
Cache is always a problem and should be assumed to exist, especially for the frontend and be treated as hard to solve highly iterable problem requiring a lot of effort; 80/20 rule.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This is an accepted solution.
@Ryan_Coremeta wrote:Are there performance or caching concerns I should be aware of when fetching real-time inventory data?
Rate limits during flash sales or high order bursts, you'll want to calculate if the store has a chance of redlining and choking on api limits. Doubly so if your polling for inventory changes instead of webhooks and then also mutating inventory or metafields for the filtering.
If limits can be hit figure and not on shopify Plus calculate the cost of just using Plus for higher rate limits, or also build remediation to wait for the rate limit quota to refill.
Or a custom velocity algorithm to hit the api at little as possible with accumulated values; e.g. 100stock to 0stock in 60 seconds should not be 100 separate requests in increments of 1, instead make it 5 requests 90, 50, 25, 5, 0 and account for overshooting early to reset inventory to be back in stock see the new inventory states https://changelog.shopify.com/posts/mark-inventory-as-unavailable .
Cache is always a problem and should be assumed to exist, especially for the frontend and be treated as hard to solve highly iterable problem requiring a lot of effort; 80/20 rule.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Thanks for the insights on rate limits and the potential of redlining. I'll consider Shopify Plus for higher limits. Your suggestion of a custom velocity algorithm to reduce API calls is noted, and I appreciate the link to the new inventory states. I'm also aware of the caching challenges and will approach it iteratively.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024