Zalando migrates real-time fraud detection from Python/scikit-learn to Scala/Spark for platform scale
Zalando's Python-based fraud detection system could not scale to the demands of its expanding fashion platform: the Python GIL blocked multithreading for concurrent predictions, training data exhausted in-house cluster memory, JSON configuration became unmanageable, and shared cluster resources created bottlenecks.
The original Python system using CherryPy for serving requests and scikit-learn for ML on a static in-house cluster failed to scale: Python's GIL prevented concurrent predictions, cluster memory capped training data size, and growing JSON config complexity blocked safe refactoring.
The new Scala and Spark system on AWS reduced overall learning time by a factor of two, cut prediction response time at 20 concurrent requests from ~1000 ms to ~70 ms, and a sparse feature condenser improved prediction accuracy by more than 25% while more than halving runtime.
Frequently asked questions
What did this team achieve with this AI workflow?
The new Scala and Spark system on AWS reduced overall learning time by a factor of two, cut prediction response time at 20 concurrent requests from ~1000 ms to ~70 ms, and a sparse feature condenser improved predictio…
What tools did this team use?
scikit-learn, CherryPy, Play framework, MLlib, Amazon S3.
What results were reported?
Model learning time: drops by a factor of two; Prediction response time at 20 concurrent requests (new vs old): ~70 ms vs ~1000 ms; Prediction accuracy improvement from sparse condenser: more than 25% improvement; Runtime reduction from sparse condenser: more than halved the runtime (source-reported, not independently verified).
What failed first in this deployment?
The original Python system using CherryPy for serving requests and scikit-learn for ML on a static in-house cluster failed to scale: Python's GIL prevented concurrent predictions, cluster memory capped training data s…
How is this order processing AI workflow structured?
Order received as JSON → Feature extraction → Imputation of missing values → Fraud probability prediction → Order routing by consumers → Training data acquisition to S3 → Distributed model training on Spark.