Chapter 20 — Real-World Scenarios
Let's apply everything to five concrete projects, showing how the decision framework leads to different architectures.
Scenario 1: Personal Technical Blog
Aspect Decision
Traffic ~1000 visitors/day, spikes when posts hit HN/Reddit
Budget $0-20/month
Team Just you
SLA Best effort (downtime is annoying, not catastrophic)
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Markdown │────▶│ Hugo/Astro │────▶│ Cloudflare │
│ files in │ │ (build step)│ │ Pages (CDN) │
│ Git repo │ │ │ │ FREE │
└──────────────┘ └──────────────┘ └──────────────┘
│
GitHub Actions
(auto-build on push)
Pattern: Static site (JAMstack)
Hosting: Cloudflare Pages (free) or Netlify (free tier)
CI/CD: GitHub Actions builds on push to main
Cost: $0/month (domain: $10/year)
Why: Zero server management, handles traffic spikes effortlessly (CDN), free
Scenario 2: Startup SaaS MVP
Aspect Decision
Traffic ~500 users, growing. API-heavy (user auth, CRUD, real-time)
Budget $50-200/month
Team 2-3 developers
SLA 99.9% (paying customers)
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ React SPA │────▶│ Vercel/ │ │ Railway │
│ (frontend) │ │ Cloudflare │ │ or Render │
└──────────────┘ │ Pages │ │ (backend) │
└──────────────┘ └──────┬───────┘
│
┌───────▼───────┐
│ Managed │
│ PostgreSQL │
│ + Redis │
└───────────────┘
Pattern: SPA + API backend (monolith)
Hosting: PaaS (Railway/Render) for backend, Vercel for frontend
Database: Managed PostgreSQL (Railway or Neon)
CI/CD: Auto-deploy on push (PaaS built-in)
Cost: ~$50-100/month
Why: Maximum development speed, minimal ops, easy to iterate. Graduate to VPS/cloud when costs justify it.
Scenario 3: E-Commerce Site
Aspect Decision
Traffic ~10K daily visitors, 5x spikes during sales
Budget $200-500/month
Team 3-5 developers + 1 DevOps
SLA 99.95% (downtime = lost revenue)
Compliance PCI-DSS (handling payments)
Architecture
┌───────────┐ ┌───────────┐ ┌───────────────────────────────┐
│CloudFront │───▶│ ALB │───▶│ ECS Fargate (containers) │
│ (CDN) │ │(HTTPS/LB) │ │ ┌─────────┐ ┌───────────┐ │
└───────────┘ └───────────┘ │ │ Web │ │ Worker │ │
│ │ (x2-4) │ │ (x1-2) │ │
│ └────┬────┘ └─────┬─────┘ │
└───────┼─────────────┼────────┘
│ │
┌───────▼─────────────▼────────┐
│ RDS PostgreSQL (Multi-AZ) │
│ ElastiCache Redis │
│ S3 (product images) │
└──────────────────────────────┘
Pattern: SSR monolith (Next.js or Django) with background workers
Hosting: AWS ECS Fargate (containers without managing servers)
Database: RDS PostgreSQL Multi-AZ (automatic failover)
Payments: Stripe (PCI compliance handled by them)
CI/CD: GitHub Actions → ECR → ECS rolling deployment
Cost: ~$300-500/month
Why: Auto-scaling for sales spikes, managed services reduce ops burden, Multi-AZ for reliability.
Scenario 4: Enterprise Internal Tool
Aspect Decision
Traffic ~200 internal users, business hours only
Budget $100-300/month
Team 1-2 developers (part-time maintenance)
SLA 99.5% (business hours)
Compliance Data must stay in EU, SSO required
Architecture
┌───────────────┐ ┌──────────────────────────────────┐
│ Corporate │────▶│ Hetzner VPS (EU) │
│ VPN / SSO │ │ ┌────────────┐ ┌────────────┐ │
│ (Okta/Azure │ │ │ Caddy │ │ App │ │
│ AD) │ │ │ (proxy) │──▶│ (Docker) │ │
└───────────────┘ │ └────────────┘ └─────┬──────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ PostgreSQL │ │
│ │ (Docker) │ │
│ └─────────────┘ │
└──────────────────────────────────┘
Pattern: Monolith (Django/Rails/Next.js)
Hosting: Single Hetzner VPS in EU (€20/mo for 4GB RAM)
Auth: SAML/OIDC integration with corporate IdP
CI/CD: GitHub Actions → Docker → SSH deploy
Cost: ~€40/month (VPS + backups)
Why: Simple, cheap, EU data residency, VPN restricts access. No need for cloud complexity for 200 users.
Scenario 5: High-Traffic Media/Content Site
Aspect Decision
Traffic ~1M daily visitors, global audience, viral spikes
Budget $2000-10000/month
Team 8-15 developers, 2-3 SRE/DevOps
SLA 99.99% (ad revenue depends on uptime)
Architecture
┌──────────────────────────────────────────────────────────────────┐
│ Cloudflare (CDN + WAF + DDoS) │
└────────────────────────────────┬─────────────────────────────────┘
│
┌────────────────────────────────▼─────────────────────────────────┐
│ AWS Multi-Region │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ EKS Cluster │ │ EKS Cluster │ │ Shared Services │ │
│ │ (Region 1) │ │ (Region 2) │ │ • S3 (media storage) │ │
│ │ │ │ │ │ • CloudFront (assets) │ │
│ │ Services: │ │ Services: │ │ • ElasticSearch │ │
│ │ • CMS API │ │ • CMS API │ │ • SQS (async jobs) │ │
│ │ • Auth │ │ • Auth │ │ • Lambda (image proc) │ │
│ │ • Search │ │ • Search │ └─────────────────────────┘ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ ┌──────▼───────┐ ┌──────▼───────┐ │
│ │ Aurora Global │ │ Aurora Read │ │
│ │ (Primary) │ │ (Replica) │ │
│ └──────────────┘ └──────────────┘ │
└───────────────────────────────────────────────────────────────────┘
Pattern: Microservices (CMS, Auth, Search, Media Processing)
Hosting: AWS EKS (Kubernetes) multi-region
Database: Aurora Global Database (cross-region replication)
CDN: Cloudflare + CloudFront (multi-layer caching)
CI/CD: GitLab CI → ECR → ArgoCD (GitOps) → EKS
Monitoring: Datadog or Prometheus + Grafana + PagerDuty
Cost: ~$5000-8000/month
Why: Global audience needs multi-region. Viral spikes need auto-scaling. Multiple teams need independent deployments (microservices). Revenue justifies the infrastructure investment.
Notice the pattern: Complexity scales with requirements, not ambition. The blog costs $0/mo and takes 30 minutes to set up. The media site costs $5000/mo and takes months to architect. Both are correct for their context. The worst mistake is using Scenario 5's architecture for Scenario 1's requirements.
← Chapter 19 — Decision Framework
Further Reading & Resources →