Based on the SAP-C02 exam guideReport an error
Spin up 10 microservices, new problems begin. How does service-a know service-b's IP? When service-b suddenly returns 5xx, how fast should service-a retry? To encrypt all comms with mTLS, who issues and rotates certificates? For canary-deploying new versions to 10% traffic, where does routing split? Solving all in application code bloats it with infrastructure logic. Service mesh moves this problem to sidecar proxies outside code. SAP exams frequently ask scenarios distinguishing AWS' three options: Cloud Map, ECS Service Connect, App Mesh.
This article examines why service mesh emerged, how sidecar proxies intercept traffic, responsibility division. Then mTLS, canary, circuit breaker implementation; App Mesh EOL announcement (2024) and successor standards. After spinning up 10 microservices on ECS/EKS/Fargate yesterday, the next question naturally asks "how make inter-service communication safe and observable?"—today answers it.
In monolithic apps, function calls happen in-process. Library calls and business logic blur together. Microservices split via network calls. Same call now traverses DNS lookup, TCP handshake, TLS handshake, HTTP request, retries, timeouts, circuit breaker, metric collection.
Initially, libraries solved all. Netflix Hystrix (2012), Ribbon, Eureka fit this. Problem: reinvent per language; version upgrade means simultaneous service redeployment. Go and Python services on the same mesh require bit-level library behavior alignment.
2016, Lyft unveiled Envoy, flipping the model: "Spin up a sidecar proxy per container; application calls localhost only." All policies—retries, metrics—Envoy handles. App code works language-agnostic, identical behavior. This foundation underpins Istio, Linkerd, AWS App Mesh.
[Traditional library pattern]
[App] ──Hystrix·Ribbon──► [Network] ──► [Other App]
Language-specific libs
[Sidecar mesh pattern]
[App] ──localhost──► [Envoy sidecar] ──mTLS·retries·metrics──► [Envoy] ──► [Other App]
Language-agnostic, sidecar handles all policies
💡 Related Theory: Sidecar pattern applies separation of concerns to infrastructure. Separating business logic (app) from cross-cutting concerns (auth, retries, observability), you solve them once and apply everywhere. Same idea appears in Spring AOP, K8s Init Containers, JavaScript middleware. Academically, Gregor Hohpe's Enterprise Integration Patterns (2003) formalized it as "Channel Adapter" pattern.
🔍 Deeper Dive: xDS API (Envoy Data Service) standardization made Envoy dominant. Control planes (Istio, App Mesh, Consul) push routing rules, certs, discovery via xDS gRPC to Envoy. Swap control planes while keeping data plane (Envoy)—multi-control-plane migration becomes possible. xDS becomes CNCF standard.
AWS offers three service mesh options. Similar names, different responsibilities.
[Manual, basic] [Automatic, rich]
│ │
▼ ▼
[Cloud Map] [ECS Service Connect] [App Mesh]
Pure registry ECS standard discovery + Full service mesh
DNS + API light mesh (Envoy sidecar)
(Envoy auto-injected) Routing, mTLS, circuit
breaker, observability
| Aspect | Cloud Map | Service Connect | App Mesh |
|---|---|---|---|
| Essence | Service Registry | ECS-integrated mesh (lightweight) | Full Service Mesh |
| Envoy sidecar | None | Auto-injected | Auto-injected |
| Discovery | DNS or HTTP API | Client-side LB | xDS-based routing |
| mTLS | None | None (2024) | ACM Private CA integration |
| Weighted routing (canary) | None | None | Virtual Router weight |
| Circuit breaker | None | Partial (retries, timeout) | Full support |
| Observability | None | CloudWatch metrics auto | X-Ray, CloudWatch integration |
| Use when | Simple discovery only | ECS standard, low ops | Full mesh features needed |
| EOL status | Active | Active (2022 GA) | EOL 2026.9 planned |
Relationship summary: "Cloud Map simplest registry, Service Connect Envoy auto-stacked lightweight mesh, App Mesh full-featured mesh."
Cloud Map (2018) is service name → resource mapping basic layer. Two namespace types:
service-a.internal returns ECS Task IP list. Most common pattern.Creating ECS Service, add serviceRegistries option auto-registering Cloud Map. Task startup registers IP+port; termination auto-deregisters. EKS can match via ExternalDNS controller, but K8s Service' native discovery overshadows Cloud Map's role in EKS.
Cloud Map's limitation: no functionality beyond that. Pure name → IP; load-balancing defers to client DNS cache and random selection. Retries, circuit breaker, mTLS—mesh features absent.
⚠️ Trap: Creating Private DNS Namespace auto-creates internal Route 53 Private Hosted Zone. Must connect to VPC for queries—VPC detail often forgotten. TTL defaults 10s (fast IP propagation), but clients caching DNS can call stale IPs. SDK-level short TTL setting is standard.
ECS Service Connect (2022 GA) builds on Cloud Map discovery, auto-injecting Envoy sidecars, providing client-side load-balancing, CloudWatch metrics, retries, timeouts by default. Enable with single ECS Service block.
aws ecs update-service \
--cluster prod --service myapp \
--service-connect-configuration '{
"enabled": true,
"namespace": "prod.local",
"services": [
{
"portName": "http",
"clientAliases": [{"port": 80, "dnsName": "myapp"}]
}
]
}'After, other ECS Services in same namespace call http://myapp/..., Envoy automatically load-balances service-a → service-b. Microservice comms work without ALB.
[Service A Task]
│
├─ App Container (calls localhost:80)
│ ↓
└─ Envoy Sidecar (auto-injected)
│
├─ Auto Cloud Map query (Service B Task IPs)
├─ Client-side load-balancing
├─ Retries, timeouts
└─ CloudWatch metrics auto-emit
│
▼
[Service B Tasks (multiple)]
│ Auto Cloud Map register/deregister
Service Connect advantage: low operational burden. No need writing Virtual Service, Router, Node manifests like App Mesh; ECS Service option block suffices. Metrics auto-flowing to CloudWatch (traffic, error rate, latency) come as default dashboard.
Downside: no full-mesh features. Weighted-canary, circuit breaker, mTLS unsupported (2024). Need them? Switch to App Mesh, or if mixing ECS+EKS, add EKS + Istio.
💡 Related Theory: Client-side load-balancing has no extra hop vs. server-side (ALB). ALB adds hop: client → ALB → server (2 hops); client-side: client → server (1 hop). Deep call chains (5-10 services) accumulate latency. gRPC's Round Robin and xDS resolvers use same thinking. Downside: client knows server list directly. Cloud Map auto-refresh solves this.
App Mesh (2019) is full service mesh using Envoy as data plane. Abstraction model: 4 layers.
[Mesh]
│ Entire mesh unit
▼
[Virtual Service] "Payment Service" logical name
│
▼
[Virtual Router] Traffic split (weighted, header-based)
│
├──[Virtual Node v1, weight=90]──► [ECS Service v1]
└──[Virtual Node v2, weight=10]──► [ECS Service v2]
This structure enables:
x-canary: true header routes to v2# Virtual Router weighted routing (abbreviated)
{
"spec": {
"httpRoute": {
"match": {"prefix": "/"},
"action": {
"weightedTargets": [
{"virtualNode": "checkout-v1", "weight": 90},
{"virtualNode": "checkout-v2", "weight": 10}
]
}
}
}
}App Mesh EOL: November 2024, AWS announced App Mesh EOL September 30, 2026. New workloads should explore alternatives (Istio on EKS, ECS Service Connect). At test authoring time (SAP-C02 v1.5 ~ 2024 exam), App Mesh remains correct answers, but new adoption not recommended operationally.
📚 Case Study: App Mesh EOL's causes: First, AWS data showed ECS Service Connect covers 70%+ ECS users' needs. Second, EKS users de facto adopted Istio/Linkerd. App Mesh occupied vague middle ground; new feature investment stalled. Similar pattern: 2023 AWS X-Ray + OpenTelemetry integration—AWS pivoting from proprietary toward CNCF standards.
🔍 Deeper Dive: Istio's control plane (istiod) tightly integrates K8s; poor ECS fit. EKS users can adopt Istio via Add-on (2024 EKS Marketplace) lightly. Linkerd is lighter but feature-reduced. Multi-cloud standardization priority → Istio; simplicity priority → Linkerd is typical recommendation.
Service mesh's largest security value: mTLS (Mutual TLS). Standard TLS, server has cert; mTLS, client+server bilateral verification. Zero Trust model's (distrust network location, authenticate all requests) core implementation.
App Mesh integrates ACM Private CA, implementing mTLS nearly automatic.
[ACM Private CA] ← Company's private authority
│
├─ Every 24h short-lived cert issuance
│
[Envoy sidecar A] ───mTLS─── [Envoy sidecar B]
│ │
└─ Bilateral cert verify│
└─ SAN confirms service ID
Three value points:
💡 Related Theory: mTLS trust model uses PKI (Public Key Infrastructure) X.509 cert chain validation. CA roots trust at top; issued certs beneath carry CA signature proving authenticity. Private CAs within company: ACM Private CA (AWS), HashiCorp Vault, Google CA (GCP). Short cert lifetime concept mirrors SPIFFE/SPIRE (CNCF) same direction; auto-rotation eliminates manual key management burden.
🎯 Scenario: "A financial company mTLS-encrypts all 50-microservice comms. Manual cert rotation is ops burden. Fitting combo?" — App Mesh + ACM Private CA (test authoring time). App Mesh EOL is operations perspective; SAP asks era-correct answers. New adoption: Istio + cert-manager + ACM Private CA operational standard; SAP still asks App Mesh.
Routing new versions to partial traffic deploys via mesh, load balancer, or CodeDeploy.
| Option | Weight granularity | Traffic split location |
|---|---|---|
| App Mesh Virtual Router | Arbitrary 1% | Mesh (Envoy sidecar) |
| ALB Weighted Target Group | 1% unit | Load balancer |
| CodeDeploy Blue/Green | Predefined Linear/Canary ratios | ALB Target Group auto-switch |
App Mesh offers finest control. Combined with header-routing: "internal employees only use v2" patterns. ALB simple 90:10 weighted target group matches roughly; header splits limited. CodeDeploy overlays deploy automation on ALB, auto-executing "10% → 30% → 100%" preset patterns.
ECS Service Connect doesn't directly support weighted routing, so canary needs CodeDeploy Blue/Green + ALB Weighted Target Group.
[CodeDeploy Blue/Green + ALB]
│
[Blue Target Group (v1, 90%)] ──► ECS Service v1
│
[Green Target Group (v2, 10%)] ──► ECS Service v2
│
▼ Gradual shift (10% → 50% → 100%)
▼ Auto-rollback on alarm
📚 Case Study: 2022, Airbnb standardized payment service canary with Istio weight routing + Prometheus metric-based auto-rollback. New version's 5xx ratio over 2× baseline instantly zeroes weight. Pattern called Progressive Delivery, tools like Flagger and Argo Rollouts standardizing it on K8s.
Mesh handles East-West (inter-service), ALB/NLB/API Gateway handle North-South (external ingress). Confusing this division costs SAP wrong answers.
[Internet]
│
▼
[CloudFront] ← Global CDN, edge caching
│
▼
[API Gateway / ALB] ← N-S ingress, auth, WAF
│
▼
[Service A (Envoy)] ← Mesh entry
│ E-W mesh comms (mTLS, canary)
[Service B (Envoy)]
│
[Service C (Envoy)]
│
▼
[RDS / DynamoDB / S3]
| Traffic | Recommended |
|---|---|
| External HTTPS + auth + WAF | API Gateway + Cognito + WAF |
| External HTTPS + simple routing | ALB |
| External TCP/UDP + static IP + high perf | NLB |
| Internal East-West HTTP, gRPC | Service Mesh (Service Connect / App Mesh) |
| External + internal mesh both | API Gateway + mesh combo |
⚠️ Trap: "Use ALB Target Group for microservice comms" works small-scale; full mTLS, canary, circuit breaker insufficient. ALB dominates N-S, mesh dominates E-W—remember responsibility division for right answers.
| Dimension | AWS | GCP | Azure |
|---|---|---|---|
| Managed mesh | App Mesh (EOL planned), Service Connect | Anthos Service Mesh (Istio-based) | Service Mesh (Open Service Mesh, OSM) |
| Discovery | Cloud Map | Service Directory | Azure Service Fabric |
| Envoy integration | Available (App Mesh, Service Connect) | Standard | Standard |
| Managed Istio | EKS Add-on | Anthos Service Mesh | AKS OSM (Deprecated 2024) |
GCP early-adopted Istio as managed mesh standard (Anthos Service Mesh). AWS built proprietary App Mesh; market adoption insufficient, EOL decided. Azure also deprecated Open Service Mesh 2024, pivoting to Istio Add-on. Cloud mesh market trend: clear Istio + Envoy single standardization.
🔍 Deeper Dive: Service Mesh Interface (SMI) was K8s SIG's attempted mesh standard API; 2023 archived. Standardization attempt failed because Istio became de facto standard, making abstract layers unnecessary. Cloud-native ecosystem "standardization" often happens via one implementation's de facto dominance, not abstract standards. K8s itself follows this pattern, as does Envoy.
Service mesh moves microservice comms' cross-cutting concerns (auth, retries, observability, encryption) to sidecar proxies. AWS offers Cloud Map (registry) / ECS Service Connect (ECS standard mesh) / App Mesh (full mesh); each responsibility differs. App Mesh EOL announced; new adoption checks Istio and Service Connect as standard, but SAP exams still accept App Mesh at test authoring.
Tomorrow synthesizes Week 7 with 12-scenario questions. Knowledge accumulated—ECS, EKS, Fargate, Karpenter, IRSA, Service Connect—branches through SAP scenarios. Multi-account, hybrid, cost optimization fused with containers—that's tomorrow's lens.
Click a choice to reveal the answer and explanation.
Question 1
A fintech runs 30 microservices on ECS Fargate. It must satisfy all of the following. (1) mTLS for all communication. (2) A 5% traffic canary for new versions. (3) A circuit breaker per service. Which tool should it use?
Question 2
Which option automatically provides simple discovery, retries, and CloudWatch metrics between microservices in an ECS Cluster, with minimal operational burden?
Question 3
External users enter over HTTPS, and JWT authentication and rate limiting are required. Internal East-West traffic uses a mesh. Which service is most appropriate for external ingress?
Question 4
In an App Mesh Virtual Router, you start with v1=100, v2=0 and raise the v2 share by 10% every hour. What is the name of this pattern?
Question 5
What is the behavior of a Cloud Map Private DNS Namespace?
Question 6
You want to protect all microservice communication with mTLS and automatically rotate certificates that live for only 24 hours. What is the most appropriate combination?
Question 7
Which feature does ECS Service Connect not support directly?