
How We Optimized Product Syncing for Facebook - Shopify
8/14/2017
This post details the optimization of the Facebook channel's product synchronization system to achieve horizontal scalability. The core problem identified was the serial processing of product updates in the backend pipeline. The solution involved replacing the serial product sync path with a concurrent one. This was implemented by using Sidekiq Pro's batching functionality, where a supervisor job enqueues a batch of product sync jobs that run concurrently. The supervisor holds a lock on the shop's domain to prevent race conditions. After product sync jobs complete, the supervisor re-enqueues itself if more products need syncing, improving worker utilization. This resulted in a significant increase in throughput and enabled horizontal scaling by adding more servers.