Case Study - A recommender that went from three seconds to under a hundred milliseconds

A global apparel brand's product recommendations took three seconds to return and could not see current inventory. We moved the digital platform to the cloud, centralised clickstream and order data, and rebuilt recommendations on a vector search index — 97 ms at p95, and a 6.8% lift in add-to-cart.

Client
Levi's
Year
Service
Search and recommendations, cloud migration, data engineering

Overview

Three problems that look separate are usually one problem.

Levi's digital estate ran on SAP Hybris, with nightly cron ETLs that had no access to site session data. Finance and merchandising waited between a day and three days for weekly performance reporting. Holiday peaks saturated on-premise capacity and the site throttled. And product recommendations took around three seconds to return, computed from stale inputs, with no view of current inventory — so the shopper was regularly recommended something the warehouse could not ship.

All three are the same problem wearing different clothes: the data describing what shoppers were doing and what the business actually had in stock was not reaching the places that needed to answer questions from it. One of those places was a human reading a report. Another was a recommender with a hundred milliseconds to decide.

The mandate was to move core digital workloads to the cloud within two quarters, without putting Black Friday at risk.

The constraint

Peak trading is a hard deadline that does not negotiate. A migration that finishes late is not late, it is cancelled — nobody re-platforms a retailer in November. That single fact shaped the sequencing: everything was built to be reversible, traffic was replayed against the new stack at three times peak before anything moved, and the production switchover was scheduled for the quietest hour of the week.

What we built

  • OpenSearch kNN vector search
  • Kinesis clickstream
  • S3 and Redshift data lake
  • Glue Spark ETL
  • ECS Fargate
  • Lambda@Edge

One place the data lands

Browser beacons and CDN logs stream into Kinesis and land as compressed columnar files in a tiered lake — raw, curated, and a zone shaped for model training. Spark jobs fire on arrival rather than on a schedule, partitioned by hour, which is what takes reporting from a nightly batch to something close to live.

The nightly cron was not slow because it was badly written. It was slow because it was nightly. Removing the schedule removed the latency.

Recommendations as a retrieval problem

The old recommender was a scoring service asked to be clever. We rebuilt it as a search index asked to be fast: product and behaviour vectors in an OpenSearch cluster with the kNN plugin, generated in batch overnight and updated for hot records within seconds by a stream consumer, queried at the edge and injected into page markup.

Framing it as retrieval rather than as machine learning is what bought the latency. Nearest-neighbour lookup against a well-tuned index is a solved problem with a known cost; inference in the request path is not. Live inventory joins the query as a filter, so the engine stops recommending what cannot be shipped.

What we chose against

OptionWhy not
Amazon PersonalizeManaged, and solves cold-start well. Higher run cost, and tuning is opaque to the merchandising team who need to influence what gets shown.
SnowflakeStrong multi-cluster warehousing, but an added licence fee and it still leaves the recommendation layer to be built separately.
Self-hosted Kafka and SparkMaximum flexibility, and the operational overhead plus timeline would have put the delivery past peak trading.

Results

Recommender p95, from 3,000 ms
97 ms
Add-to-cart conversion uplift
+6.8%
Report latency, from 6–10 hours
9 min
Read-only freeze at switchover
24 min

The migration completed inside a six-week window against a two-quarter mandate — architecture held in the US, engineering running from our team in Vadodara, which is what compresses a two-quarter plan into six weeks. Production switchover ran at two in the morning on a Sunday with a twenty-four minute read-only freeze, and full parity verified before traffic returned.

The number worth arguing about is the 6.8% lift in add-to-cart. It came from two changes made together — a recommender fast enough to run in the page, and one that could see inventory — and we would not claim a clean split between them.

More case studies

Making a warehouse of unlabelled art searchable

A fine art logistics group knew where every object was, but only a trained operator could find it — and half the catalogue was described as "Statue". We opened a read path out of the legacy ERP, then used computer vision to give the objects the words their records never had.

Read more

Customer-held encryption keys on a shared search cluster

Enterprise buyers in regulated sectors wanted cryptographic ownership of their own data. Atlassian ran search on shared Elasticsearch clusters encrypted with platform-managed keys. A two-person team proved customer-held keys could work there without touching the services above.

Read more

Tell us about your project

Our offices

  • USA
    Palo Alto, CA
    Oakland, CA
  • INDIA
    Vadodara, GJ