Design an uptime monitoring service like a small Pingdom or UptimeRobot. Customers register URLs, and the service requests each one every minute from three regions. If a URL fails from at least two regions, the owner is alerted by email or SMS, and the incident appears on the customer's public status page. The service monitors 200,000 URLs, which means about 10,000 checks per second across all regions. Status pages and the dashboard receive about 500 requests per second at peak, rising sharply during big outages.
Functional requirements
Register a URL with a check interval and expected status code
Check every URL from three regions on schedule
Alert the owner by email or SMS when a URL is down from at least two regions
Show response-time history and a public status page
Non-functional requirements
Alerts go out within 2 minutes of an outage starting
One region's network problem does not trigger false alerts
Status pages stay up when many customers are down at once
Constraints and scale
200,000 monitored URLs, checked every 60 seconds from 3 regions
About 10,000 checks per second, 860 million results per day
Keep raw results for 30 days and hourly summaries for 2 years
You will practise
Spread scheduled work evenly over a pool of workers with a scheduler and queue
Store and query time-stamped results efficiently
Reduce false alarms by confirming failures from more than one vantage point
Show 2 hints
If every check fires at second zero of each minute, what happens to the workers?
A single failed request is not an outage. What evidence should an alert need?