Back to explorer
System Architectures• 40 Min

Design a Price Tracking & Alert System (CamelCamelCamel)

MEDIUM

Design a Price Tracking & Alert System (CamelCamelCamel)

Price tracking platforms track historical pricing fluctuations across millions of products on Amazon, Best Buy, and Walmart, notifying bargain-hunters via email or SMS when an item drops below their target threshold.


1. System Requirements

Functional Requirements

  1. Track Product: Users can paste an e-commerce URL and set a desired target price (e.g. *"Alert me if Sony WH-1000XM5 drops below $250"*).
  2. Periodic Price Ingestion: System periodically fetches the current price for all monitored product IDs.
  3. Price History Charting: Display historical price movements over 1-year and all-time spans.
  4. Trigger Notifications: When a price drop is confirmed, immediately dispatch an email/push notification to all subscribed users.

Non-Functional Requirements

  1. Politeness & Anti-Bot Resilience: Rotate proxy IPs, adhere to rate limits, and randomize request intervals to avoid IP bans.
  2. Dynamic Polling Intervals: Products with volatile prices or high popularity are checked more frequently (e.g. every 1 hour) than dormant products (once every 24 hours).

Key Architecture Trade-Offs & Decision Matrix

Decision FactorChoice AChoice BSelected Architectural Rationale
Communication ProtocolREST over HTTP/2WebSockets / gRPCUse REST for stateless CRUD APIs; use WebSockets for low-latency bidirectional streaming.
State ManagementCentralized Distributed StoreLocal Memory with Sticky SessionsCentralized Redis / Database state allows seamless container auto-scaling and zero-downtime rolling deploys.
Concurrency ControlOptimistic Locking (version column)Pessimistic Locking (SELECT FOR UPDATE)Optimistic locking delivers superior throughput for low-conflict consumer operations.