Infrastructure Design
When to activate
When designing cloud infrastructure for new services, scaling existing systems, planning disaster recovery, optimizing costs, or conducting infrastructure reviews. Also when evaluating trade-offs between compute options, networking topologies, storage strategies, or disaster recovery approaches.
When NOT to use
For minor configuration tweaks or troubleshooting existing infrastructure. Use this skill when designing from scratch or making major architectural decisions.
Instructions
1. Gather Requirements
Before designing, establish:
Application Requirements:
- Expected traffic volume (requests/sec, peak vs average)
- Data volume (GB/TB), growth rate
- Latency requirements (p99 target)
- Availability target (99.9%, 99.95%, 99.99%)
- Compliance requirements (HIPAA, PCI-DSS, SOC2, etc.)
Operational Requirements:
- Team size and skill level (Kubernetes expertise, automation capability)
- On-call support model (24/7, business hours, hybrid)
- Disaster recovery targets (RTO, RPO)
- Budget constraints
Technology Stack:
- Programming languages and frameworks
- Database types (SQL, NoSQL, time-series)
- Message queues or event systems
- Caching requirements
2. Design Core Architecture
Define the foundational layers:
Compute Layer:
- Platform: Kubernetes, ECS, Lambda, Heroku, or self-managed VMs
- Instance sizing: CPU, memory requirements per container
- Horizontal scaling: Min/max replicas, scaling triggers
- Vertical scaling: Reserved capacity, spot instances
- Network location: Single region, multi-region, edge
Data Layer:
- Primary database: PostgreSQL, MySQL, DynamoDB, BigQuery
- Backup strategy: Frequency, retention, tested recovery
- Replication: Synchronous vs asynchronous, read replicas
- Encryption: At-rest and in-transit, key management
- Schema design: Normalized, sharded, or partitioned
Networking:
- VPC/VNet: CIDR ranges, subnet layout (public/private)
- Load balancing: Application vs network load balancer
- Service mesh: Istio, Linkerd, or native load balancing
- Security groups/NACLs: Ingress/egress rules
- DNS: Internal service discovery, external domains
- CDN: For static content and API response caching
Storage:
- Object storage: S3, GCS, Azure Blob
- Bucket structure: By data type, tenant, or time period
- Lifecycle policies: Transition to cold storage, deletion
- Encryption and access control
- Backup and versioning
3. Define Resilience
Plan for failures:
High Availability:
- Multi-zone deployments: Replicas across availability zones
- Load balancer health checks: Endpoint, frequency, failure threshold
- Graceful shutdown: Connection draining, in-flight request completion
- Circuit breakers: Fail fast when downstream is unavailable
Disaster Recovery:
- RTO (Recovery Time Objective): How long can you be down?
- RPO (Recovery Point Objective): How much data loss is acceptable?
- Backup strategy: Daily snapshots? Continuous replication? Point-in-time recovery?
- Failover procedure: Automated or manual? How long to execute?
- Testing schedule: Monthly, quarterly, or annual DR drills
Cost Optimization:
- Identify non-critical workloads suitable for spot instances
- Reserved capacity for baseline traffic
- Auto-scaling policies to shed load during peak
- Metrics to track cost per request/transaction
4. Plan Security
Establish security posture:
Authentication & Authorization:
- Service-to-service auth: mTLS, API keys, or OAuth2
- User authentication: IAM, OIDC, or custom
- Secrets management: Vault, AWS Secrets Manager, or encrypted configs
Network Security:
- Firewall rules: Only necessary ports and protocols
- Egress filtering: Which external services can instances reach?
- VPN or private connectivity for sensitive data
Compliance & Audit:
- Encryption requirements: TLS 1.2+, AES-256
- Audit logging: Who accessed what, when
- Data retention: How long to keep logs and backups
- Penetration testing: Schedule and scope
5. Document Architecture
Create diagrams and docs:
Architecture Diagram:
- Show compute, data, networking, and external services
- Label connections and data flows
- Indicate redundancy and failover paths
Decision Log:
- Why Kubernetes vs ECS?
- Why PostgreSQL vs DynamoDB?
- Why multi-region vs single region?
- What was rejected and why?
Cost Projection:
- Baseline monthly cost estimate
- Cost at 2x and 10x traffic
- Cost optimization opportunities
Deployment Procedure:
- Steps to provision infrastructure
- Terraform/CloudFormation files
- Helm charts for Kubernetes
- Testing checklist before production
Example
Design: User Onboarding Service
Requirements:
- 1,000 requests/sec average, 5,000 peak
- 99.9% availability (1,000 minutes error budget per month)
- GDPR compliance required
- Multi-region deployment desired
Compute:
- Kubernetes on EKS (multi-region)
- Deployment: 3 replicas per region, minimum
- Auto-scaling: Scale up at 70% CPU, down at 30%
- Instance type: t3.large for staging, c5.xlarge for production
Data:
- PostgreSQL RDS: Multi-AZ primary with read replicas in other regions
- Backups: Daily snapshots, 30-day retention
- Replication: Asynchronous to read replicas (5 second lag acceptable)
- Sharding: Not needed until 10,000+ requests/sec
Networking:
- VPC CIDR: 10.0.0.0/16
- Private subnets: 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24 (one per AZ)
- Public subnets: 10.0.101.0/24, 10.0.102.0/24, 10.0.103.0/24 (NAT gateways)
- Load balancer: Application Load Balancer (ALB) with TLS termination
- Service mesh: Istio for observability and circuit breaking
Security:
- TLS 1.3 for all connections
- mTLS for service-to-service communication
- Secrets managed in AWS Secrets Manager, rotated every 90 days
- RBAC: Separate IAM roles for each service
- Network policies: Only permit necessary traffic between services
Disaster Recovery:
- RTO: 15 minutes (acceptable for non-critical onboarding)
- RPO: 1 hour (we can accept losing up to 1 hour of signups)
- Backup strategy: Continuous replication to standby region
- Failover: Automated DNS switch to secondary region if primary becomes unavailable
- Testing: Quarterly DR drills with failover simulation
Cost Estimate:
- EKS cluster: $73/month
- EC2 instances (6 nodes at c5.xlarge): $2,100/month
- RDS Multi-AZ: $2,500/month
- NAT Gateway: $32/month
- Data transfer: $200/month
- Total: ~$4,900/month
Decision Log:
- Why EKS + Kubernetes? Need multi-region, automatic scaling, and observability
- Why PostgreSQL? Structured data, ACID transactions required, known scaling patterns
- Why not DynamoDB? Requires application-level partitioning, operational complexity for this scale
- Why multi-region? Reduce latency for global users, survive region-level outages
Success Criteria
A well-designed infrastructure:
- Meets SLOs: Achieves target availability, latency, and error rates
- Scales horizontally: Can handle 10x traffic by adding resources, not rewriting code
- Recoverable: RTO/RPO targets are documented and tested quarterly
- Secure: Encryption, authentication, and audit logging in place before production
- Observable: Metrics, logs, and traces enable rapid issue diagnosis
- Documented: Architecture decisions recorded; runbooks exist for common issues
- Cost-optimized: No obvious waste; costs track with revenue or usage metrics
1---2name: infrastructure-design3description: Infrastructure Design4metadata:5 source: https://skillmd.com/skills/uitbreidenos/infrastructure-design6---7# Infrastructure Design89## When to activate1011When designing cloud infrastructure for new services, scaling existing systems, planning disaster recovery, optimizing costs, or conducting infrastructure reviews. Also when evaluating trade-offs between compute options, networking topologies, storage strategies, or disaster recovery approaches.1213## When NOT to use1415For minor configuration tweaks or troubleshooting existing infrastructure. Use this skill when designing from scratch or making major architectural decisions.1617## Instructions1819### 1. Gather Requirements2021Before designing, establish:2223**Application Requirements:**24- Expected traffic volume (requests/sec, peak vs average)25- Data volume (GB/TB), growth rate26- Latency requirements (p99 target)27- Availability target (99.9%, 99.95%, 99.99%)28- Compliance requirements (HIPAA, PCI-DSS, SOC2, etc.)2930**Operational Requirements:**31- Team size and skill level (Kubernetes expertise, automation capability)32- On-call support model (24/7, business hours, hybrid)33- Disaster recovery targets (RTO, RPO)34- Budget constraints3536**Technology Stack:**37- Programming languages and frameworks38- Database types (SQL, NoSQL, time-series)39- Message queues or event systems40- Caching requirements4142### 2. Design Core Architecture4344Define the foundational layers:4546**Compute Layer:**47- Platform: Kubernetes, ECS, Lambda, Heroku, or self-managed VMs48- Instance sizing: CPU, memory requirements per container49- Horizontal scaling: Min/max replicas, scaling triggers50- Vertical scaling: Reserved capacity, spot instances51- Network location: Single region, multi-region, edge5253**Data Layer:**54- Primary database: PostgreSQL, MySQL, DynamoDB, BigQuery55- Backup strategy: Frequency, retention, tested recovery56- Replication: Synchronous vs asynchronous, read replicas57- Encryption: At-rest and in-transit, key management58- Schema design: Normalized, sharded, or partitioned5960**Networking:**61- VPC/VNet: CIDR ranges, subnet layout (public/private)62- Load balancing: Application vs network load balancer63- Service mesh: Istio, Linkerd, or native load balancing64- Security groups/NACLs: Ingress/egress rules65- DNS: Internal service discovery, external domains66- CDN: For static content and API response caching6768**Storage:**69- Object storage: S3, GCS, Azure Blob70- Bucket structure: By data type, tenant, or time period71- Lifecycle policies: Transition to cold storage, deletion72- Encryption and access control73- Backup and versioning7475### 3. Define Resilience7677Plan for failures:7879**High Availability:**80- Multi-zone deployments: Replicas across availability zones81- Load balancer health checks: Endpoint, frequency, failure threshold82- Graceful shutdown: Connection draining, in-flight request completion83- Circuit breakers: Fail fast when downstream is unavailable8485**Disaster Recovery:**86- RTO (Recovery Time Objective): How long can you be down?87- RPO (Recovery Point Objective): How much data loss is acceptable?88- Backup strategy: Daily snapshots? Continuous replication? Point-in-time recovery?89- Failover procedure: Automated or manual? How long to execute?90- Testing schedule: Monthly, quarterly, or annual DR drills9192**Cost Optimization:**93- Identify non-critical workloads suitable for spot instances94- Reserved capacity for baseline traffic95- Auto-scaling policies to shed load during peak96- Metrics to track cost per request/transaction9798### 4. Plan Security99100Establish security posture:101102**Authentication & Authorization:**103- Service-to-service auth: mTLS, API keys, or OAuth2104- User authentication: IAM, OIDC, or custom105- Secrets management: Vault, AWS Secrets Manager, or encrypted configs106107**Network Security:**108- Firewall rules: Only necessary ports and protocols109- Egress filtering: Which external services can instances reach?110- VPN or private connectivity for sensitive data111112**Compliance & Audit:**113- Encryption requirements: TLS 1.2+, AES-256114- Audit logging: Who accessed what, when115- Data retention: How long to keep logs and backups116- Penetration testing: Schedule and scope117118### 5. Document Architecture119120Create diagrams and docs:121122**Architecture Diagram:**123- Show compute, data, networking, and external services124- Label connections and data flows125- Indicate redundancy and failover paths126127**Decision Log:**128- Why Kubernetes vs ECS?129- Why PostgreSQL vs DynamoDB?130- Why multi-region vs single region?131- What was rejected and why?132133**Cost Projection:**134- Baseline monthly cost estimate135- Cost at 2x and 10x traffic136- Cost optimization opportunities137138**Deployment Procedure:**139- Steps to provision infrastructure140- Terraform/CloudFormation files141- Helm charts for Kubernetes142- Testing checklist before production143144## Example145146### Design: User Onboarding Service147148**Requirements:**149- 1,000 requests/sec average, 5,000 peak150- 99.9% availability (1,000 minutes error budget per month)151- GDPR compliance required152- Multi-region deployment desired153154**Compute:**155- Kubernetes on EKS (multi-region)156- Deployment: 3 replicas per region, minimum157- Auto-scaling: Scale up at 70% CPU, down at 30%158- Instance type: t3.large for staging, c5.xlarge for production159160**Data:**161- PostgreSQL RDS: Multi-AZ primary with read replicas in other regions162- Backups: Daily snapshots, 30-day retention163- Replication: Asynchronous to read replicas (5 second lag acceptable)164- Sharding: Not needed until 10,000+ requests/sec165166**Networking:**167- VPC CIDR: 10.0.0.0/16168- Private subnets: 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24 (one per AZ)169- Public subnets: 10.0.101.0/24, 10.0.102.0/24, 10.0.103.0/24 (NAT gateways)170- Load balancer: Application Load Balancer (ALB) with TLS termination171- Service mesh: Istio for observability and circuit breaking172173**Security:**174- TLS 1.3 for all connections175- mTLS for service-to-service communication176- Secrets managed in AWS Secrets Manager, rotated every 90 days177- RBAC: Separate IAM roles for each service178- Network policies: Only permit necessary traffic between services179180**Disaster Recovery:**181- RTO: 15 minutes (acceptable for non-critical onboarding)182- RPO: 1 hour (we can accept losing up to 1 hour of signups)183- Backup strategy: Continuous replication to standby region184- Failover: Automated DNS switch to secondary region if primary becomes unavailable185- Testing: Quarterly DR drills with failover simulation186187**Cost Estimate:**188- EKS cluster: $73/month189- EC2 instances (6 nodes at c5.xlarge): $2,100/month190- RDS Multi-AZ: $2,500/month191- NAT Gateway: $32/month192- Data transfer: $200/month193- **Total: ~$4,900/month**194195**Decision Log:**196- Why EKS + Kubernetes? Need multi-region, automatic scaling, and observability197- Why PostgreSQL? Structured data, ACID transactions required, known scaling patterns198- Why not DynamoDB? Requires application-level partitioning, operational complexity for this scale199- Why multi-region? Reduce latency for global users, survive region-level outages200201---202203## Success Criteria204205A well-designed infrastructure:2062071. **Meets SLOs:** Achieves target availability, latency, and error rates2082. **Scales horizontally:** Can handle 10x traffic by adding resources, not rewriting code2093. **Recoverable:** RTO/RPO targets are documented and tested quarterly2104. **Secure:** Encryption, authentication, and audit logging in place before production2115. **Observable:** Metrics, logs, and traces enable rapid issue diagnosis2126. **Documented:** Architecture decisions recorded; runbooks exist for common issues2137. **Cost-optimized:** No obvious waste; costs track with revenue or usage metrics214215---