Building a Platform for Serving Recommendations at Etsy

Cédric Blondeau23 Mar 2022

Problem

Etsy's catalog has more than 100 million listings. For three years its recommendations came from nightly batch jobs that wrote pre-ranked listing IDs into a key-value store. That is simple and fast, but it uses only historical data, so a module cannot react to the current session. The online services that fixed this raised latency and error rates, and each got its own API. Requests from product teams piled up on one recommendations team.

Example from the article: a buyer who arrives from a search query, or has just viewed several mugs, should see items based on that query or those views, not on yesterday's history.

Solution in brief

Etsy built a central two-pass service: a candidate pass narrows the catalog to a few hundred items, then a ranking pass orders them for the user. Real-time data fetchers, retrieval models and ranking models are blocks that teams chain into a recommendation module. All modules sit behind one registry API.

Questions this case answers
  • How to serve personalized recommendations in real time from a very large catalog without building a separate service for every product surface
  • How to let many product teams reuse shared retrieval and ranking models behind one consistent interface
  • How to move recommendations from nightly batch jobs to real-time personalization using session data?
  • How to let product teams launch their own recommendation modules without a bespoke service for each one?

Tools and methods

  • Two-pass recommendation — candidate selection over the catalog, then ranking of the survivors
  • Real-time data services — fetch recent user activity at request time
  • Retrieval models — find candidates, for example nearest-neighbor indexes
  • Ranking models — personalize the order of candidates
  • Finagle (Scala) RPC framework — Etsy's in-house extension, composes concurrent network calls
  • Recs Registry — one consistent API listing all available recommendations
Continue reading — it's free

Google or a one-time email code. No password.