1---2name: systems-architect3description: Design infrastructure, networks, and cloud systems with integration, reliability, and security patterns.4---5
6# Systems Architecture Rules
7
8## Infrastructure Design
9- Design for failure at every layer — hardware fails, networks partition, regions go down
10- Redundancy costs money, downtime costs more — calculate acceptable risk
11- Prefer managed services for undifferentiated work — run less, build more
12- Infrastructure as code from day one — manual changes drift and break
13- Immutable infrastructure beats patching — replace, don't repair
14
15## Cloud Architecture
16- Multi-AZ minimum, multi-region for critical systems — availability zones fail together sometimes
17- Right-size first, auto-scale second — baseline must be correct
18- Reserved capacity for steady load, spot/preemptible for bursts — cost optimization requires planning
19- Egress costs add up — keep traffic within regions when possible
20- Cloud vendor lock-in is real — abstract where escape matters, accept where it doesn't
21
22## Networking
23- Private subnets for workloads, public only for load balancers — minimize attack surface
24- VPC peering and transit gateways for multi-account — plan topology before scaling
25- DNS for service discovery — hardcoded IPs break migrations
26- Zero trust: authenticate and encrypt internal traffic — perimeter security isn't enough
27- Network segmentation limits blast radius — flat networks let attackers roam
28
29## Integration Patterns
30- APIs for synchronous, queues for asynchronous — match pattern to requirements
31- Event-driven for loose coupling — producers don't know consumers
32- Service mesh for complex microservices — observability and security at network layer
33- Rate limiting and backpressure protect systems — don't let slow consumers crash fast producers
34- Dead letter queues for failed messages — don't lose data, process later
35
36## Reliability
37- Define SLOs before building — what does "up" mean for this system?
38- Error budgets allow controlled risk — 99.9% means 8 hours downtime per year is acceptable
39- Blast radius reduction: cell-based architecture — limit how many users one failure affects
40- Chaos engineering in staging first — break things intentionally before production breaks accidentally
41- Runbooks for every alert — 3 AM isn't debugging time
42
43## Disaster Recovery
44- RTO (recovery time) and RPO (data loss) are business decisions — architect for the requirement
45- Backups aren't recovery until tested — restore regularly
46- Hot/warm/cold standby each have trade-offs — cost vs speed of recovery
47- Cross-region replication for critical data — single region is single point of failure
48- DR drills reveal real problems — plan meets reality
49
50## Security
51- Defense in depth: multiple barriers — one layer will fail
52- Least privilege for services too — not just users
53- Secrets management centralized — no secrets in code, config files, or environment variables in images
54- Audit logging for compliance and forensics — you'll need it after a breach
55- Patch aggressively — known vulnerabilities are actively exploited
56
57## Monitoring and Observability
58- Metrics, logs, and traces together — each tells part of the story
59- Alerting on symptoms, not causes — users down matters, CPU high might not
60- Dashboards for each service with golden signals — latency, traffic, errors, saturation
61- Distributed tracing across services — follow requests end to end
62- Log aggregation with retention policy — balance cost and forensic needs
63
64## Capacity Planning
65- Measure current baseline before projecting — can't scale what you don't measure
66- Load test to find breaking points — theory differs from reality
67- Capacity leads demand — scaling takes time, be ahead
68- Cost modeling for growth scenarios — 10x users is rarely 10x cost
69- Review quarterly at minimum — patterns change
70
71## Migration and Evolution
72- Strangler fig pattern for legacy replacement — route traffic gradually
73- Blue-green or canary for infrastructure changes — test in production safely
74- Database migrations are hardest — plan data migration separately
75- Rollback plans before rollout — assume failure, prepare for it
76- Communicate maintenance windows — surprises damage trust