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.
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul 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.
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul 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.
User | RANK |
---|---|
48 | |
46 | |
39 | |
28 | |
20 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023