Viral Startup Marketing Site: Surviving 50,000 Req/Sec Surges
How a high-growth startup architected an edge-cached static landing page with 99.8% cache hit ratios to survive Super Bowl and Product Hunt traffic spikes.
1. Business Problem & Context
A high-growth fintech startup was featured during a national television broadcast and on the front page of Product Hunt simultaneously. In past launches, their dynamic server infrastructure crashed within 40 seconds under 15,000 concurrent connections, resulting in lost conversions and brand damage.
2. Requirements & Constraints
- Absorb 50k+ req/sec without scaling backend servers.
- Sub-30ms Global Latency for all marketing landing pages.
- DDoS & Bot Mitigation using AWS WAF rate limiting.
- Edge A/B Testing without client-side layout shift (CLS).
3. Architecture Overview & Data Flow
Interactive Architecture Diagram (Use controls to zoom & pan)
- WAF Layer 7 Inspection: Filters malicious bot traffic, brute force requests, and IP-based rate limiting (e.g. max 2,000 requests per 5 minutes per IP).
- Edge Function A/B Routing: Inspects user cookies at the edge and rewrites URI to variant A (
/index.html) or variant B (/v2/index.html) in <1ms. - Origin Shielding: A centralized CloudFront Origin Shield caches requests between regional edge caches and S3, ensuring S3 receives fewer than 100 requests/sec even during peak viral loads.
4. AWS Services Used & Rationales
AWS Services Architecture Rationale
Concrete reasons why these specific services were chosen over alternatives
| Service | Category | Architectural Rationale ("Why this service?") |
|---|---|---|
| Amazon CloudFront | Networking | Absorbs concurrency across 450+ PoPs globally with automatic Tier 1 transit. |
| AWS WAF | Security | Blocks DDoS floods, SQLi, and scrapers before they hit the origin. |
| CloudFront Functions | Compute | Executes lightweight JavaScript at edge locations for instant A/B test routing. |
5. Key Design Trade-offs
Architecture Decision & Trade-Off Matrix
Evaluating alternative approaches under real-world constraints
Dynamic SSR Node.js Clusters
- + Dynamic rendering per request
- − Extreme server autoscaling lag
- − High cost ($800+/mo during spikes)
- − Prone to database connection exhaustion
Static Generation + CloudFront Origin Shield (Chosen)
✓ Chosen Design- + Near-infinite edge scalability
- + Zero backend servers to scale
- + 99.8% cache hit ratio
- + Costs < $25 during spike
- − Dynamic personalization requires client-side API hydration
6. Implementation Highlights
Edge Compute CloudFront Function A/B Cookie Router
function handler(event) {
var request = event.request;
var cookies = request.cookies;
// Check if visitor has existing AB test cookie
if (cookies.ab_group && cookies.ab_group.value === 'b') {
request.uri = request.uri.replace('/index.html', '/variant-b.html');
}
return request;
} 7. Results & Key Metrics
- Peak Load: Handled 52,400 requests/sec with 0 downtime.
- Bandwidth Offload: 99.82% of all traffic served from edge cache.
- Infrastructure Bill: Total AWS cost for the viral launch was $21.40.
8. Key Architectural Takeaways
Scale Law: When scaling for unknown traffic spikes, the best way to handle 50,000 requests/second is to never let them reach your servers in the first place.