情境
Design the core data model for a large-scale flash sale platform that issues limited coupons, handles high-concurrency redemption, and records orders.
這張圖裡有什麼
看懂背後的決策。
01
Separated CouponTemplate from Coupon to support millions of generated coupon codes with shared rules
02
Linked UserCoupon to both User and Coupon to track redemption state per user
03
Modeled FlashSaleItem as an independent entity connecting flash events to coupon templates with dedicated stock counters
Reuse for any coupon-driven promotion system that needs to model inventory-limited coupons, per-user issuance limits, flash sale events, and order history.