Skip to content
← Engineering blog
API GatewayServerlessArchitectureCost

Sixteen API Gateways and Not One REST API

Every one of our backend services sits behind API Gateway's newer HTTP API type. Why we never reached for the original REST API, and what that trade actually costs.

Sreeraj VR, Founder, Gaim.zone7 min read

When we counted our backend's API Gateways for the previous post, we found sixteen of them — fifteen plain APIs, one WebSocket. Not one is API Gateway's original REST API type. Every single one is the newer HTTP API. That wasn't sixteen separate decisions; it was one decision, made once, early, that nobody since has had a reason to revisit.

Two products with the same job, different price tags

AWS sells two things called "API Gateway" that both put a Lambda function behind a URL: the original REST API, and the newer, deliberately slimmer HTTP API. They overlap on the basics — routing, a custom domain, a JWT authorizer — and diverge on what REST APIs can do that HTTP APIs can't: request/response transformation templates, API keys and usage plans, built-in caching, WAF attached directly to the API. We use none of those. Every request we receive either needs authenticating or it doesn't, and either way a Lambda function decides what happens next — there was never a transformation template or a usage plan we were reaching for.

What's left after you don't need the extra features is a straightforward price and latency difference: AWS prices HTTP APIs well below REST APIs for the same request volume, and the simpler request path shaves real microseconds off each one. For a backend that is, by request count, mostly small authenticated JSON calls — look up a league, submit a bid, fetch a profile — that's the entire decision. There was no REST-API version of this backend we migrated away from; every service was built on HTTP APIs from its first commit.

One exception on purpose: the socket layer

The lone WebSocket API among the sixteen sits in front of the service that tracks who's connected to an auction room — not the auction's own traffic, which travels over that connection once it's open, but the connect/disconnect bookkeeping itself. API Gateway's WebSocket support doesn't have an HTTP-API-vs-REST-API choice to make; it's its own product, and it's the only piece of this stack where a persistent connection, rather than a request/response call, is the right primitive at all.

What we'd check before copying this

"Always pick HTTP APIs" isn't the lesson — plenty of real systems need a REST API's request transformation or its request-level caching, and paying less for a product that can't do what you need isn't a saving. The lesson is narrower: we checked the feature list against what our Lambda functions were already doing, found nothing we'd lose, and took the cheaper, faster option — once, for the whole backend, instead of relitigating it service by service. Sixteen independent teams making the same call independently would have been a coincidence. One shared answer, applied consistently, was a decision.

What actually decides it (simplified)
Do you need request/response mapping templates, API keys,
usage plans, or caching built into the gateway itself?

  NO  → HTTP API. Cheaper, faster, less to configure.
  YES → REST API, and know which feature you're paying for.

Need a long-lived, bidirectional connection instead of
request/response at all?

  → Neither. That's a WebSocket API — a different product,
    not a flag on either of the above.

See the APIs in action

Run a free practice auction in your browser — no sign-up required to watch, no real money anywhere in the bidding.

🎯 No real-money auctions · Pure strategy · Free to download