It is important to design your architecture as highly-available and fault-tolerant. To achieve the goal, you need to understand how AWS services work in multi-AZs and in multi-regions.
Regional vs AZ
| Services | Features | Multi-Regions | Multi-AZs |
|---|---|---|---|
| Auto Scaling Group | ASG is a regional service. Target instances can span across multiple AZs in a region. | No | Yes (Manual) |
| Elastic Load Balancer | No | Yes (Manual) | |
| Route 53 | Use health checks for automated DNS failovers or routing traffic by latency across regions | Yes | |
| CloudFront | Global Service; Origins in a group can be across AWS Regions. | Yes | |
| Global Accelerator | Associates the static IP addresses to regional AWS resources or endpoints | Yes | |
| VPCs – Transtit Gateway | Connect cross-region VPCs by peering regional Transit Gateways | Yes | |
| AWS Certificate Manager (ACM) | No | ||
| ElasticCache -REDIS | Multi-AZ with high-availability and auto-failover | No | Yes |
| ElasticCache – Memcahced | Mutli-threaded architecture | No | No |
| CloudFormation | Use “StackSets” to deploy stacks in multiple regions in multiple accounts. | Yes | Yes |
| Beanstalk | Yes (Manual) | ||
| ECS (EC2) | Yes | ||
| Fargate | Yes | ||
| RDS – Multi-AZ deployment | Synchronous Standby in another AZ | Yes | |
| RDS – Read Replicas | Read-only scaling, Asynchronous replication – Eventual consistency | Yes | |
| Aurora | Data is stored in multi-AZ automatically. | Yes | |
| Aurora – Read Replicas | Cross-region read only connection | Yes | |
| Aurora Global Database | Cross-region failover | Yes | |
| DynamoDB | Spread data across at least 3 AZs. | No | Yes |
| DynamoDB Global Tables | Multi-region redundancy for high-availability | Yes | |
| MemoryDB for Redis | Redis-compatible in-memory database | No | Yes |
| API Gateway | No | ||
| Lambda | No | ||
| S3 | Store objects in multi-AZ except One-Zone-Infrequent access | Yes | |
| S3 Replication | CRR (Cross Region Replication) SRR (Same Region Replication) | Yes | Yes |
| EFS | Yes (Manual) | ||
| CloudWatch Logs | You can aggregate cross-region, cross-account logs to a single destination such as Kinesis Data Stream. | Yes | |
| CloudTrail | Yes | ||
| Secrets Manager | No | ||
| Secrets Manager – Read Replica | Yes | ||
| Systems Manager Parameter Store | No | ||
| KMS – Multi-region Key | Multi-region replica key | Yes |
ASG & ELB
- Auto Scaling Group
- When one Availability Zone becomes unavailable, ASG launches new instances in other unaffected AZs.
- When the unhealthy AZ returns to a healthy state, ASG automatically redistributes the instances evenly across all of the designated AZs.
- Elastic Load Balancer
- Target EC2 instances within a region
CloudFormation
Cross-Stack Reference
- You can use the Export Output Values to export the name of the resource output for a cross-stack reference.
- You cannot create cross-stack references across regions.
- For each AWS account, export names must be unique within a region.
- You can use the “Fn:ImportValue” to import only values that have been exported within the same region.
StackSets
- Use StackSets for multi-region deployment.
DynamoDB
- Data will be saved in at least 3 AZs with the automatic synchronous replication.
- You can use “Global Tables” for multi-region redundancy.
