Microservices Architecture
Independently deployable services, each owning its data and business capability.
Overview
Microservices decompose a monolith into small, independently deployable services. Each service owns its business domain and data store, communicates through APIs or events, and can be scaled, deployed, and failed in isolation.
Core Principles
Single Responsibility
Each service does one thing and does it well. Bounded by a business capability, not a technical layer.
Decentralized Data
Each service owns its own database. No shared schemas. Consistency through events, not transactions.
Fault Isolation
One service failing doesn't cascade. Circuit breakers, bulkheads, and timeouts contain failure.
Deploy Independently
Each service has its own CI/CD pipeline. Deploy without coordinating with other teams.
Key Patterns
- API Gateway — single entry point, handles routing, auth, rate limiting
- Service Discovery — services find each other dynamically (AWS Cloud Map)
- Circuit Breaker — fail fast, prevent cascading failures
- Saga Pattern — distributed transactions across services via events
- Event Sourcing — store state as a sequence of events for full audit trail
AWS Services
- Compute: ECS, EKS, Fargate, Lambda
- Communication: API Gateway, SQS, SNS, EventBridge
- Data: RDS (per service), DynamoDB, ElastiCache
- Observability: X-Ray (distributed tracing), CloudWatch, OpenSearch
References
ECS Microservices CloudFormation
Complete architecture with ECS, ALB, and service discovery
GitHubTerraform EKS Module
EKS cluster for Kubernetes-based microservices
GitHubMicroservices on AWS
AWS whitepaper — patterns, anti-patterns, and implementation guides
AWS WhitepaperWell-Architected Microservices Lens
Framework guidance specifically for microservices
AWS Docs