Instead of deploying all infrastructure in a single CloudFormation stack, we separate resources into multiple stacks based on their lifecycle, dependencies, and blast radius.

Contains shared, stateful resources that rarely change:
Characteristics:
Each microservice has its own stack:
Characteristics:
| Criteria | Core Stack | Service Stack |
|---|---|---|
| Change Frequency | Rarely (monthly) | Often (daily/weekly) |
| State | Stateful (data) | Stateless (compute) |
| Sharing | Shared across services | Service-specific |
| Deployment Time | Long (5-10 min) | Short (2-3 min) |
| Blast Radius | High (affects all) | Low (affects one service) |
| Recreation Cost | High (data loss risk) | Low (no data loss) |
Problem: In a monolithic stack, any change affects all resources.
Solution: With multi-stack, updating Article Service doesn’t impact Auth or Media services.
Example:
# Update only Article Service
./deploy-service.sh article-service staging
# Other services (auth, media, gallery) remain untouched
Impact: π΄ High - Prevents cascading failures
Problem: Can’t deploy services independently in monolithic stack.
Solution: Each service can be deployed, rolled back, or updated independently.
Example:
# Deploy new feature to Article Service
./deploy-service.sh article-service staging
# Rollback if issues found
aws cloudformation delete-stack --stack-name travel-guide-article-service-staging
# Other services continue running normally
Impact: π΄ High - Enables continuous deployment
Problem: Monolithic stack takes 15-20 minutes to deploy.
Solution: Service stacks deploy in 2-3 minutes.
Comparison:
Impact: π‘ Medium - Improves developer productivity
Problem: Teams block each other when working on same stack.
Solution: Teams can work on different service stacks simultaneously.
Example:
Impact: π΄ High - Enables team scalability
Problem: Rolling back monolithic stack affects all services.
Solution: Rollback only the affected service stack.
Example:
# Bug found in Article Service
aws cloudformation delete-stack --stack-name travel-guide-article-service-staging
# Redeploy previous version
git checkout v1.2.3
./deploy-service.sh article-service staging
# Auth, Media, Gallery services unaffected
Impact: π΄ High - Reduces downtime
Problem: CloudFormation has 500 resource limit per stack.
Solution: Distribute resources across multiple stacks.
Example:
Impact: π’ Low - Prevents hitting limits
Problem: Can’t optimize costs per service in monolithic stack.
Solution: Tag and track costs per service stack.
Example:
Tags:
- Key: Service
Value: ArticleService
- Key: Environment
Value: staging
- Key: CostCenter
Value: Engineering
Impact: π‘ Medium - Enables cost attribution
| Aspect | Monolithic Stack | Multi-Stack Pattern |
|---|---|---|
| Deployment Time | 15-20 minutes | 2-3 minutes (per service) |
| Blast Radius | All services affected | Single service affected |
| Rollback | All services rolled back | Single service rolled back |
| Team Collaboration | Sequential (blocking) | Parallel (non-blocking) |
| Resource Limit | 500 (can hit limit) | 500 per stack (scalable) |
| Cost Tracking | Difficult | Easy (per service) |
| Complexity | Low (single stack) | Medium (multiple stacks) |
| Maintenance | Difficult (large template) | Easier (small templates) |
graph TD
Core[Core Stack] --> Auth[Auth Service]
Core --> Article[Article Service]
Core --> Media[Media Service]
Core --> AI[AI Service]
Core --> Gallery[Gallery Service]
Core --> Notification[Notification Service]
style Core fill:#ff9999
style Auth fill:#99ccff
style Article fill:#99ccff
style Media fill:#99ccff
style AI fill:#99ccff
style Gallery fill:#99ccff
style Notification fill:#99ccff
Deployment Order:
β Use Multi-Stack when:
β Avoid Multi-Stack when: