KatInterview

Design a High-Throughput Product Catalog Sync Pipeline

System DesignModel answer
HardModel answerSystem Designdistributed-systemsmessage-queuesdata-pipelines

Last updated

Architect an async ingestion system that handles billion-scale bulk feed files and real-time single-item edits, prioritizing price/stock updates over heavy image processing.

Background

A large shopping platform lets sellers keep their product listings current through two channels: periodic bulk data files (CSV, TSV, or XML exports containing up to several million rows) and an always-on REST API for immediate one-off changes — like instantly flagging an item as sold out.

Both channels feed the same downstream catalog, which powers search, recommendations, and shoppable surfaces. Your task is to design the pipeline that takes data from both sources and makes it reliably visible downstream.

What You Are Building

Design a scalable, asynchronous product catalog update pipeline that can handle:

  • Bulk feed ingestion: Files submitted by merchants on a schedule or via webhook, each potentially containing up to 10 million product rows.
  • Real-time single-item edits: A low-latency REST API for immediate attribute changes (price, stock level, title, etc.).
  • Two-tier SLA:
    • Price and availability changes must propagate downstream within 2 minutes.
    • Non-critical fields (descriptions, secondary metadata) and image work (fetching URLs, resizing into multiple resolutions, deduplication) may take up to 2 hours.
  • Conflict resolution: A bulk file generated hours ago may still be processing when a merchant also submits a real-time edit to the same item. The correct final state must win.

Scale and Constraints

DimensionTarget
Total active products1 billion across 1 million merchants
Average update rate~100 million products per day
Peak burstUp to 50,000 updates/second during morning ingestion windows
API availability99.99% uptime
Feed filesUp to 10 million rows per merchant per run

Additional constraints worth addressing:

  • Bulk files frequently re-submit unchanged data. Redundant writes, database updates, and external image downloads must be avoided.
  • Availability SLAs apply only to the single-item API; bulk worker pipelines must be fault-tolerant but not strictly real-time.

What to Cover

Structure your answer around these areas:

  1. End-to-end architecture — ingestion service, file chunking, queuing, worker tiers, and the image processing pipeline.
  2. Storage and data model — primary catalog store vs. staging, supporting both write bursts and fast point lookups.
  3. Prioritization mechanism — how critical fields (price, stock) skip or bypass the slower content and image pipeline.
  4. Conflict resolution — handling out-of-order writes and races between bulk feeds and real-time API edits.
  5. Cost and efficiency optimizations — delta detection, hashing, and deduplication strategies.

A strong answer will move from back-of-envelope estimates to API design, architecture diagram, storage choices with explicit trade-offs, and a concrete conflict resolution strategy backed by a data model.

Hints

Hint 1

Before jumping into components, derive concrete numbers first: average and peak write rates, estimated catalog size on disk, and image object count. The design decisions — queue partition counts, worker fleet sizing, storage choice — should follow directly from those numbers. Interviewers notice when the architecture floats free of the scale it is supposed to handle.

Hint 2

Think about splitting each product update by field group rather than treating the whole row as one atomic unit. Price and stock are tiny payloads that must move fast; image resizing is compute-heavy and can lag for an hour. If both go into the same queue behind the same workers, images will always threaten the price SLA. Separation at the message level — not just at worker priority — is the cleane…

Hint 3

Conflict resolution falls apart if you use arrival time instead of event time. A bulk file generated at 8 AM but processed at 10 AM must not overwrite an API edit made at 9 AM. Think about where timestamps come from (who sets them, whether client clocks are trusted), what granularity they operate at (item level vs. field-group level), and how you make the resulting writes idempotent and replayable…