SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 54
Design parts compatibility for an e-commerce site
Shoppers on an auto parts site choose their car (year, make, model, trim, engine) and expect every product to say "Fits your 2016 Civic EX 1.5L" or "Does not fit". The catalog comes from hundreds of suppliers, each describing compatible vehicles in its own format and naming.
Requirements
- Shoppers save a vehicle and see a fits, does not fit, or unknown badge on every product page and search result.
- Browse and search a category filtered to parts that fit the selected vehicle, with price sorting and facets.
- Ingest supplier fitment feeds (weekly full files and daily changes) and map their vehicle names to one canonical vehicle catalog.
- Show the conditions behind an answer, for example "rear axle only" or "with disc brakes".
Constraints and assumptions
- 150,000 canonical vehicle configurations; 20 million parts from 800 suppliers.
- About 2 billion part-to-vehicle fitment pairs once supplier rules are expanded.
- 20,000 product and search page views per second at peak; each needs fit answers for up to 48 parts, adding under 50 ms.
- Full supplier files are up to 5 GB; corrected fitment must be live within 24 hours.
- A wrong "fits" causes a costly return; "unknown" is acceptable when the data is unclear.
Out of scope for the first sketch
Checkout, pricing and stock levels · Decoding vehicle identification numbers (assume a service returns a vehicle configuration id) · Reviews · Recommending alternative parts
Draw your design
Rough math and notes
SYSTEM DESIGN SKETCHBOOK / FOLLOW-UPS
Design parts compatibility for an e-commerce site
Finish your first sketch before answering these. Cross out freely.
- Supplier A writes "Chevy Silverado 1500 LT 5.3" and supplier B "Chevrolet Silverado 1500 (LT) V8 5.3L". How do both map to the same vehicle, and what happens when you are not sure?
- A search for brake pads that fit one vehicle must be sorted by price with facets. Where does the fitment filter run?
- Many parts fit "all 2010-2018 Corollas". Do you store expanded pairs or ranges, and how does that choice affect reads and writes?
- A supplier sends a bad file that marks 300,000 parts as fitting every truck. How do you stop it from going live, and how do you roll back if it does?
- The site expands to phone cases and laptop batteries. What in your data model is car-specific, and what carries over?
Compare afterwards: worked approaches and reading at sketchbook /questions/parts-compatibility/review