Challenge 3: A media portal for users worldwide
The situation
A media portal serves articles, images and video to readers in three regions, all from one origin in North America. It gets slower the farther away a reader is, and at this traffic the origin cannot keep up.
Traffic
30,000 requests a second. Users are in North America (50%), Europe (30%) and Asia-Pacific (20%). A round trip to the origin takes 20 ms from North America, 90 ms from Europe and 160 ms from Asia-Pacific. The nearest CDN edge is 10 ms from any user.
| Operation | Share | Steps |
|---|---|---|
| Read | 97% | Read data |
| Write | 3% | Write data |
- Read97%Read data
- Write3%Write data
Data
A CDN can answer 80% of reads at an edge. A cache answers 85% of the reads that reach it.
What you are proving
Distance is a cost you can design around: readers far from the origin get answers about as fast as readers near it, and the origin carries only the requests that have to reach it.
Rules
- The origin stays in North America, and the network times are as given.No design shortens the network; it can only avoid it.
- Every write goes to the origin.A CDN only keeps copies of responses; a change has to reach the database.
Builds on
Targets
- Serve all 30,000 requests a second
- Average at most 70 ms
- At least 99.99% available, with no single point of failure
- At most 2,350 USD a month
- Any tier loses one instance: nothing dropped, no tier over 80% busy