Design Retailer Product Catalog Serving
Design full-snapshot catalog ingestion with observable incremental refreshes, low-latency shopper reads, retailer deletions, and durable administrator overlays.
Problem statement
For this exercise, assume retailers upload complete, immutable product-catalog snapshot files each day.
A validated newer snapshot is applied incrementally: shoppers may temporarily observe a documented mix of old and new retailer values while the refresh is in progress, but a stale worker or older snapshot must never overwrite a value already applied from a newer snapshot.
Shoppers browse all currently visible SKUs for one retailer and read product details. Authorized administrators can set or clear audited field-level overrides; an active override takes precedence over retailer data and survives later refreshes.
A retailer deletion hides the product even when override history exists, while clearing an override on a surviving product reveals the newest applied retailer value.
Design file comparison and validation, snapshot ordering, incremental application, durable base and overlay state, list and detail APIs, caching, daily scaling, failure recovery, reconciliation, and observability.
Checkout, ordering, inventory reservation, recommendations, advertising, and image transformation are outside scope.
What to build
- A retailer can upload and finalize a versioned complete snapshot file, inspect validation and incremental-refresh status, and retry without letting an older snapshot or stale worker overwrite newer applied values.
- A shopper can list all currently visible products for one retailer with stable cursor behavior and explicit refresh metadata even while a validated snapshot is being applied incrementally.
- A shopper can read one visible product assembled from the newest applied retailer value for that product plus any active administrator overrides.
- An authorized administrator can idempotently set or clear a field-level override with reason, audit history, and a definitive effective version; clearing exposes the newest surviving retailer value.
- A deletion in the newer retailer snapshot hides the product from list and detail reads without erasing override audit history.
At scale
- For this exercise, assume 50,000 retailers with a highly skewed catalog distribution: 20,000 products per retailer on average and a median of 50.
- For this exercise, assume 50 million users, 11,000 aggregate shopper list or detail queries per second, and a 400 millisecond p95 latency target for healthy reads.
- For this exercise, each retailer may provide one complete snapshot per day; target thirty minutes p95 for a normally sized validated refresh to converge and five seconds p95 for an accepted administrator override to become visible.
- For this exercise, retain raw snapshots for thirty days and version, refresh, override, and audit evidence for one year; acknowledged metadata and active overrides must survive a zone failure.