CloudVectra Logo CloudVectra
CloudVectra Knowledge Hub

Microservices on AWS: When Distributed Architecture Costs More Than Expected

Trace the cost of service boundaries through API Gateway, ECS/EKS, NAT, sidecars and telemetry, and compare a modular monolith.

6 min read

1. The scenario: one checkout becomes twelve services

A retail team splits checkout, catalog, pricing, tax, inventory and notification logic into separate deployments. Independent ownership and scaling are useful: catalog reads and payment writes have different demand and release cycles. The bill grows faster than orders because every small service receives a permanent runtime, ingress, telemetry and network path.

Distributed architecture can be justified. Its value should be compared with the actual service boundary cost, including operational work and failure handling. Counting only application vCPUs misses much of that cost.

Examples use illustrative USD assumptions and a 730-hour month, excluding taxes and discounts. They are arithmetic models, not live regional quotes.

2. How it works: follow one business operation

A customer request reaches an edge API, fans out to several synchronous dependencies and emits an asynchronous event. Each dependency has connection pools, timeouts, retries and a deployment floor. A proxy or service mesh can improve discovery and policy while consuming CPU and memory.

API Gateway is not automatically involved in every ECS/EKS call. Internal discovery, internal load balancing and ECS Service Connect are different paths. Only count gateway calls that actually traverse it, and distinguish HTTP APIs, REST APIs and WebSocket billing. API Gateway pricing is not one universal per-request rate.

Standard ECS orchestration on EC2 has no extra orchestration charge; the instances and other resources still cost money. Fargate bills selected task resources and runtime. ECS Managed Instances adds a management fee to underlying EC2 pricing. ECS pricing describes these choices. Service Connect has no separate feature fee, but its proxy uses billable compute resources.

AWS microservices architecture showing resource dependencies and the costs to evaluate.

3. Cost components: the minimum deployment matters

ComponentWhat expands after a split
RuntimeMinimum tasks/pods per service and failure headroom
PlatformEKS control planes or selected managed compute fees
CommunicationGateway requests, load balancing, bytes and private egress
Supporting processesSidecars, agents, service discovery and certificates
TelemetryLogs, spans, custom metrics, queries and retention
DataSeparate stores, replicas, synchronization and event consumers

Private tasks using a NAT gateway for internet or public AWS service endpoints create processing charges as well as gateway hours. Image pulls, package downloads and exporters can contribute even when customer response payloads are small. An S3 gateway endpoint or suitable interface endpoint may change the path; neither is a blanket answer for every dependency.

4. Where things go wrong: boundary multiplication

A service handling 0.1 vCPU on average may still reserve a full task shape and run two copies. Twelve independently replicated services create a larger floor than three well-defined deployable modules. Shared pools can improve utilization, but require a plan for tenant isolation and noisy neighbors.

Retries make the cost nonlinear during failure. If each of four nested layers allows three total attempts, the deepest dependency can receive up to 3⁴ = 81 attempts for one original operation in a worst-case cascading retry pattern. This is not normal traffic volume; it illustrates why retry budgets, exponential backoff, jitter and idempotency belong in the architecture.

A synchronous chain also accumulates latency and availability dependencies. Queueing can decouple work, but adds publishing, consumption, retries and dead-letter handling. Do not assume replacing HTTP with events makes communication free.

Logging the same request body at every hop increases storage and may expose sensitive information. Keep correlation identifiers in logs and traces, while avoiding unbounded identifiers as metric dimensions.

5. Real-world example: the deployment floor dominates

Suppose twelve services each run two tasks. For this model, the chosen task shape costs $0.025/hour including vCPU and memory. An alternative groups tightly coupled modules into three deployables, each still running two tasks of the same shape. Benchmark that shape; merging workloads can require larger tasks.

Monthly componentTwelve deployablesThree deployables
Task runtime24 × 730 × $0.025 = $438.006 × 730 × $0.025 = $109.50
Edge API and ingressAssumed $80Assumed $60
Network processing/transferAssumed $90Assumed $35
TelemetryAssumed $160Assumed $70
Total$768.00$274.50

The modeled difference is $493.50/month. It is conditional on both candidates meeting throughput and availability requirements with those task sizes. Database costs and engineering time are excluded from both columns; add their differences before claiming total savings.

A million business operations with five gateway-traversing calls each create five million gateway requests before retries. At an assumed $1 per million eligible requests, that portion is $5, not $500. This prevents an equally common error: blaming a conspicuous network boundary while the permanent runtime and telemetry floor dominates.

6. Alternatives: choose boundaries with independent value

A modular monolith keeps code ownership and module interfaces while deploying fewer runtimes. It can be economical when teams release together and most calls are tightly coupled. Enforce module boundaries and ownership so the application remains maintainable.

Extract a service when it needs a materially different scaling curve, security boundary, failure isolation or independent delivery cadence. A high-volume asynchronous image processor is a stronger candidate than a tiny validation wrapper called in every request.

ECS can suit teams that need containers without Kubernetes APIs. EKS can justify its platform cost when Kubernetes capabilities and organizational scale are useful. Fargate removes node administration, while EC2 capacity can provide economical packing for steady workloads. Compare the complete operating model.

7. Practical recommendations

Trace one successful order and one failed order. Count calls, bytes, spans and database round trips. Record each service’s minimum replica count, requested resources, p95 usage and business owner.

Set end-to-end deadlines and allocate retry budgets across layers. Cap fan-out and queue concurrency to protect databases. Test partial failure, not only peak throughput. Use bounded metric labels and selective payload logging.

Review service extraction proposals with an explicit expected benefit and incremental monthly floor. Measure cost per successful operation after release; a lower compute line can hide rising proxy, NAT and log charges.

8. CloudVectra perspective: keep ownership across shared services

CloudVectra cost insights helps compare runtime, networking and monitoring spend across accounts. Cost Centers provides an allocation framework for the application and shared platform.

Use measured calls, bytes or reserved capacity as allocation inputs where appropriate, and document how the shared base is distributed. Service traces and scheduler telemetry remain the evidence for causality. Anomaly detection supports investigation when deployment or retry changes alter spend.

Continue the architecture series

Sources and further reading

Choose whether CloudVectra may load optional analytics. You can change this at any time.

Cookie names, providers, and retention