SD-53 · Back to the write-up
Design a Parts Compatibility
Check and compile supplier rules into a vehicle set per part, then answer fit checks from that set and searches from an index with vehicle ids.
Follow a request
Fit check · cache hit
Fit check · cache miss
Search for my vehicle
Publish a supplier feed
Roll back a bad feed
Clients
Edge
Services
Data and pipeline
ShopperWeb or app
SupplierUploads feeds
CDNSelector + pages
Load balancerSpreads traffic
App serversStateless
Fit cacheHot parts
Fitment storepart → vehicles
Search indexFilter by vehicle
Validate + compilePer feed
Rules DBSource of truth
The numbers, at a glance
9 cache hits1 store lookup
120 GBPairs table
100 GBRules DB
10 GBCompiled
1 GBHot cache
2.5% wrong97.5% right
A fit check, in order
Cache miss shown. On a hit, steps 4 and 5 disappear.
Shopper
Load balancer
App server
Fit cache
Fitment store
1 GET /parts/5530/fit?vehicle_id=1203
2 route
3 GET fit:5530
4 miss: GET part 5530
5 set v42 + notes
6 set v42
7 fits with notes
8 200 + question
RequestResponseAsync, does not block
How a fit check is answered
The decision this question is really about.
GET fit
JOIN 300M rules
10 work units a check
+ Always fresh.− A join per request.
GET fit
fitment(part, vehicle)
120 GB; feeds rewrite millions
+ Key lookups.− 2B rows; big rewrites.
Feed → validate → compile
part → vehicle setindex: fits field
Cache hot sets
+ One lookup; 10 GB; cacheable.− A compile step per feed.
How it grows
Add a box only when a number forces you to. Highlighted boxes are new at each stage.
Shopper
App server
SQL database
Shopper
Load balancer
App × N
Search indexSQL database
ShopperSupplier feeds
Load balancerValidator
App × NCompiler
Search indexFitment storeRules DB
ShopperSupplier feeds
CDNValidator
App × NFit cacheCompiler
Search indexFitment storeRules DB
Was this walkthrough useful?Your vote tells us what to improve next.