TheLittlePrince
Performance Discrepancy Between Localhost and Railway Deployment using NodeJS
Correct, the script itself is not very compute-intensive. It is mainly performing API requests, data comparison, and making updates if needed. The 2-second delay is strictly to ensure we don't exceed Shopify's or ERP rate limits
17 replies
Performance Discrepancy Between Localhost and Railway Deployment using NodeJS
During the 45-minute period:
1. The script is primarily performing a synchronization operation between Shopify and ERP via their respective APIs for all our product variants. (~40.000 variants)
2. For each product variant, we grab its barcode, inventory quantity, and price from Shopify.
3. Using the barcode as the identifier, we match the product variant with a product in ERP and retrieve its current price and inventory quantity.
4. If there are discrepancies in the price or inventory quantity between Shopify and Sedona for the same product variant, we use Shopify's API to update the product variant's details in Shopify to match ERP.
5. This procedure repeats for all product variants, thus the need for a large number of API calls.
6. We have incorporated delays of roughly 2 seconds between API calls to avoid being rate-limited.
17 replies