liveBook · Manning

API gateway

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

An architectural component that serves as an entry point between clients and backend services.

An API gateway is the customer-facing entry point into a microservices application. It can serve the frontend UI and expose a REST API that forwards client requests to backend services. section 10.7.3 section 10.13

A gateway commonly handles these responsibilities:

  • Serves the browser-based frontend through which customers interact with the application. section 10.7.3
  • Forwards HTTP requests into the cluster and presents backend capabilities through client-facing routes. section 10.7.3
  • Provides a place to add authentication before allowing users to reach backend microservices. section 10.7.3
  • Supports either one shared gateway or separate gateways for web, mobile, and administrator frontends when their requirements differ. section 10.7.3

Forwarding a video request

In FlixTube, the browser requests GET /api/video from the gateway. The gateway requests the video-streaming service, receives a stream, and pipes it back to the browser. The video-streaming service separately forwards the video-storage request and emits a viewing event, keeping those backend responsibilities separate from the gateway. section 10.7.5

Figure 10.9 What FlixTube would look like with multiple gateways

Compare a single gateway with a possible backends-for-frontends design for browser, mobile, and administrator access. section 10.7.3

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains frontend serving, REST routing, streaming, authentication, and gateway topology, while deferring advanced multi-service route composition.
Examples
Demonstrates FlixTube’s /api/video route forwarding a streamed response from video-streaming to the browser.
What it assumes
Assumes familiarity with HTTP clients, frontend applications, and microservices while introducing gateway placement through a working video application.
What you can do after
Operate/configure a gateway that exposes frontend routes, forwards backend requests, and separates client access from internal services.
How it connects
Connects API gateways with microservices, REST APIs, authentication, backends for frontends, DNS, and HTTP streaming.

Also explained in

Compare how 6 books explain API gateway →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.