2.4 Reliability Requirements
Decoupling Architectures
Event-Driven Architecture (Cheatsheet)
| Service | Pattern | Ordering | Persistence |
|---|---|---|---|
| SQS | Queue (Producer → Consumer) | Standard: No. FIFO: Yes. | Yes (up to 14 days) |
| SNS | Pub/Sub (Topic → Subscribers) | No guarantee | No (unless delivery fails) |
| EventBridge | Event Bus (Rule-based routing) | No guarantee | No (unless Archived) |
| Kinesis | Streaming (Real-time data) | Yes (within shard) | Yes (up to 365 days) |
API Gateway
- Throttling: Protect backend by setting rate limits (RPS).
- Caching: Cache responses to reduce load on backend (Lambda/DynamoDB).
- Integration Types:
- Lambda Proxy: Passes raw request to Lambda. Flexible.
- AWS Service: Direct integration with AWS Services (e.g., PutItem to DynamoDB).
Scaling Strategies
Auto Scaling Groups (ASG)
- Target Tracking: “Keep CPU at 50%“. (Preferred).
- Step Scaling: “If CPU > 50%, add 2. If > 80%, add 4”.
- Simple Scaling: “If Alarm breaches, add 1”. (Legacy using Cooldown periods).
- Lifecycle Hooks: Run custom actions (scripts) before instance starts/terminates.
Service Quotas
- Soft Limits: Can be increased via Service Quotas console / Support ticket.
- Hard Limits: Cannot be increased (e.g., Lambda payload size 6MB).
WARNING
Exam Gotcha: SQS Standard Queues have “At-Least-Once” delivery (duplicates possible) and “Best-Effort” ordering. FIFO Queues have “Exactly-Once” delivery and strict ordering but lower throughput (300/3000 TPS).