Contents

Chapter 1

Overview

This chapter covers the core features and capabilities of Microservices Architecture Guide.

Overview

This guide provides battle-tested IaC templates and patterns for building a microservices architecture on AWS. It covers the full stack from service decomposition strategy through deployment, networking (API Gateway + service mesh), and end-to-end observability. Every template is deployable and extensively commented.

What's Included

FileDescription
cloudformation/api-gateway.yamlAPI Gateway with Lambda authorizer, rate limiting, WAF integration
cloudformation/ecs-service-mesh.yamlECS Fargate services with App Mesh sidecar proxies
cloudformation/observability-stack.yamlCloudWatch, X-Ray, Container Insights, custom dashboards
terraform/api-gateway.tfTerraform API Gateway with OpenAPI integration
terraform/ecs-fargate-service.tfECS Fargate service module with auto-scaling
terraform/service-mesh.tfApp Mesh virtual services, routers, and nodes
terraform/variables.tfShared variables for all Terraform configurations
kubernetes/service-deployment.yamlK8s Deployment with readiness/liveness probes
kubernetes/istio-virtualservice.yamlIstio traffic management and circuit breaking
kubernetes/network-policies.yamlK8s NetworkPolicy for service isolation
scripts/service_decomposition_analyzer.pyAnalyzes domain boundaries and suggests decomposition
scripts/api_contract_generator.pyGenerates OpenAPI specs from service definitions
docs/architecture.mdReference architecture with Mermaid diagrams
docs/decomposition-patterns.mdService decomposition decision framework
docs/observability-guide.mdObservability instrumentation guide
examples/api-gateway-openapi.yamlOpenAPI 3.0 spec for a sample API
examples/service-catalog.jsonExample service registry / catalog
LICENSEMIT License

Architecture at a Glance

┌─────────────────────────────────────────────────────────┐
│                   API Gateway / ALB                      │
│               (Rate limiting, Auth, WAF)                 │
├──────────┬──────────┬───────────┬───────────────────────┤
│          │          │           │                         │
│  User    │  Order   │  Product  │   Payment              │
│  Service │  Service │  Service  │   Service              │
│  (ECS)   │  (ECS)   │  (ECS)   │   (ECS)               │
│          │          │           │                         │
├──────────┴──────────┴───────────┴───────────────────────┤
│              Service Mesh (App Mesh / Istio)             │
│         (mTLS, Circuit Breaking, Retries, Tracing)       │
├─────────────────────────────────────────────────────────┤
│              Observability (X-Ray, CloudWatch)           │
│        (Distributed tracing, Metrics, Structured logs)   │
└─────────────────────────────────────────────────────────┘
Chapter 2

Prerequisites

Follow this guide to get Microservices Architecture Guide up and running in your environment.

Prerequisites

  • AWS Account with ECS, API Gateway, App Mesh, CloudWatch, X-Ray permissions
  • AWS CLI v2 configured
  • Python 3.10+ (for helper scripts)
  • Terraform >= 1.5 (if using Terraform templates)
  • kubectl + eksctl (if using Kubernetes templates)

Quick Start

Step 1: Analyze Your Domain

Use the decomposition analyzer to assess service boundaries:

bash
python3 scripts/service_decomposition_analyzer.py --interactive

Step 2: Design Your API

Generate an OpenAPI spec from your service catalog:

bash
python3 scripts/api_contract_generator.py \
  --catalog examples/service-catalog.json \
  --output my-api-spec.yaml

Step 3: Deploy the API Gateway

bash
aws cloudformation deploy \
  --template-file cloudformation/api-gateway.yaml \
  --stack-name microservices-api-gw \
  --parameter-overrides Environment=staging \
  --capabilities CAPABILITY_NAMED_IAM

Step 4: Deploy a Service

bash
aws cloudformation deploy \
  --template-file cloudformation/ecs-service-mesh.yaml \
  --stack-name user-service \
  --parameter-overrides ServiceName=user-service ImageUri=123456789012.dkr.ecr.us-east-1.amazonaws.com/user-service:latest

Step 5: Enable Observability

bash
aws cloudformation deploy \
  --template-file cloudformation/observability-stack.yaml \
  --stack-name microservices-observability

Cost Notes

ComponentMonthly Cost (10 services, moderate traffic)
API Gateway (REST)~$30-100 (per million requests)
ECS Fargate (10 services x 0.5 vCPU)~$150-300
App MeshFree (included with ECS)
CloudWatch Logs~$20-50 (depending on log volume)
X-Ray Traces~$5-15 (first 100K traces/month free)
Total~$200-500/month
Chapter 3
🔒 Available in full product

FAQ

You’ve reached the end of the free preview

Get the full Microservices Architecture Guide and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $39 →
📦 Free sample included — download another copy for the full product.
Microservices Architecture Guide v1.0.0 — Free Preview