Problem
Ozon matches offers from different sellers to merge them into one product, rank the best offers first and reward sellers. The matching pipeline ran as batch Spark jobs over a catalog of more than 100 million products. New products waited days for a match, jobs failed with the cluster, runtime was hard to predict, and answering "why did this product not match?" took long ad hoc digging. Customers also wanted matches on request.
Example from the article: a client asks for matches of chosen items, or a new product appears, and the match must arrive in minutes.
Solution in brief
The team replaced the batch pipeline with Kafka-connected services: GPU embedding inference, approximate nearest neighbor search on an HNSW index, and a CatBoost model on fewer features. The fast model learns from human labels plus the old offline model's predictions. A match now takes about 2 minutes on average.
Questions this case answers
- How to find duplicate or equivalent entities in a catalog of more than 100 million items within minutes of an update, when a batch pipeline takes a day or more
- How to keep a pairwise matching model fast enough for a stream when its offline version needs many expensive pair features
- How to find matches for a new or updated product in minutes instead of waiting for a daily batch run?
- How to run candidate search and a feature-heavy matching model on a stream of product updates?
Tools and methods
- NVIDIA Triton Inference Server — serves text and image embedding models on GPUs
- HNSW index on Spark Structured Streaming — sharded candidate search over active products
- CatBoost — matching model with 2.5 times fewer features than the offline one
- Apache Kafka — links the services and takes matching requests
- Redis and PostgreSQL — match cache with a one-day TTL, and a key-value store of image embeddings
Google or a one-time email code. No password.
