Shopify builds real-time ML embedding pipelines processing 2,500 embeddings per second for Semantic Search
Shopify merchants needed search results that reflected consumer intent beyond keyword matching, and product and image updates needed to be reflected in search results nearly instantly after creation or modification.
The initial image embedding pipeline ran into Out of Memory errors on n1-standard-16 machines; switching to n1-highmem-16 machines resolved the OOM issue but increased costs by 14%. Batching also proved ineffective — due to bursty input topics, elements were being organized in bundles of 1, sending batches of 1 to the GPU.
Shopify now processes roughly 2,500 embeddings per second (216 million per day) in near real time across image and text pipelines, achieved a ~2.6x memory footprint decrease, and eliminated the extra 14% in cost by reverting to n1-standard-16 machines.
Frequently asked questions
What did this team achieve with this AI workflow?
Shopify now processes roughly 2,500 embeddings per second (216 million per day) in near real time across image and text pipelines, achieved a ~2.6x memory footprint decrease, and eliminated the extra 14% in cost by re…
What tools did this team use?
Dataflow, BigQuery, Apache Beam, T4 GPU.
What results were reported?
Embeddings processed per second: 2,500; Embeddings processed per day: 216 million; Memory footprint decrease: ~2.6x; Worker cost increase (eliminated by optimization): 14% (source-reported, not independently verified).
What failed first in this deployment?
The initial image embedding pipeline ran into Out of Memory errors on n1-standard-16 machines; switching to n1-highmem-16 machines resolved the OOM issue but increased costs by 14%.
How is this ecommerce ops AI workflow structured?
Event triggers pipeline → Image preprocessing → Embedding vector generation → Write to data warehouse and event topic.