Lambda or Fargate: a decision built from numbers

zero-ground-4451 pts0 comments

Lambda or Fargate: a decision built from numbers | by Illya Yalovoy | Jun, 2026 | MediumSitemapOpen in appSign up<br>Sign in

Medium Logo

Get app<br>Write

Search

Sign up<br>Sign in

Member-only story

Lambda or Fargate: a decision built from numbers

Illya Yalovoy

18 min read·<br>Just now

Listen

Share

Two ways to run a Rust HTTP service on AWS: Lambda functions behind API Gateway, or a container on Fargate behind an ALB. Both work. The internet is full of opinions about which one is “right” — almost all unsupported, almost none calibrated to a real service shape.<br>This post is the calibration. The same Rust service — a small JSON store on top of DynamoDB, 25 KB payloads, three operations — deployed on both runtimes in the same account, in the same region, hit by the same client. Throughput, latency distributions, cost crossover, and operational shape, all measured. Then a decision framework that points at a single answer for each operating regime.<br>The short version.<br>Latency-bound services use Fargate. Across the entire distribution (p50, p99, p99.9, max) Fargate beats Lambda by measurable, repeatable factors for this Rust workload — p50 by ~4×, p99.9 by ~10×, max by ~10×. Lambda’s tail above p99.9 lives in the 400–1000 ms band; Fargate’s stays under 100 ms. If you need stable, predictable latency, the data is decisive.<br>Cost-bound services with sustained traffic above ~30 RPS use Fargate. Below 30 RPS Lambda wins, often by an order of magnitude (at 1 RPS, Lambda is 30× cheaper). Above 30 RPS the gap inverts and widens linearly: at 100 RPS Fargate is ~70% cheaper; at 500 RPS ~92% cheaper. Over 3 years at 100 RPS Fargate saves ~$8,400.<br>Genuinely unpredictable traffic that can 5× in 90 seconds uses Lambda. Fargate’s autoscaler…

Written by Illya Yalovoy<br>7 followers<br>·8 following

Help

Status

About

Careers

Press

Blog

Store

Privacy

Rules

Terms

Text to speech

fargate lambda decision built from numbers

Related Articles