Writers can now attach pictures and files to their notes, about 300 KB each. Every attachment someone opens leaves the database through its network card, and since attachments launched, plain notes have slowed down too. The database's CPU is barely busy.
What it does
- Read: a user opens a note (2 KB) or an attachment (about 300 KB).
- Write: a user saves a note or uploads an attachment.
Workload
Two kinds of traffic, 4 000 rps in all for 15 seconds: notes, 70% of requests at 2 KB each, and attachments, 30% at about 300 KB each. Mostly reads, against 10 000 notes.
How to build it
The app tier is fixed: four medium replicas behind a load balancer. You choose the database: its tier and its read replicas. Each node's network card sends:
| Tier | Bandwidth per node | Price per node |
|---|---|---|
| Small | 1 Gbps | $0.12/h |
| Medium | 2.5 Gbps | $0.30/h |
| Large | 5 Gbps | $0.70/h |
| XLarge | 10 Gbps | $1.50/h |
- Connect both clients to the load balancer, then the app servers, then the database. Run it as it is.
- How many bits a second do the attachments need? Compare that with the database's card.
- Give the reads enough bandwidth, for as little as you can.