liveBook · Manning

Streaming

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

Node.js streaming is the incremental processing and transfer of data through Node.js stream objects rather than loading the complete data set at once.

Node.js streaming transfers data incrementally through readable streams and HTTP responses instead of requiring the whole video to be handled at once. A stream can be piped to a response, while Node.js and Express manage the pipeline. section 2.6.5

Stream a local video

An Express GET route opens a video file with the filesystem API, sets the response headers, then pipes the file’s readable stream to the HTTP response. section 2.6.5

A video can pass through several streaming stages before reaching the browser:

  • Azure Storage supplies a readable stream to the video-storage response. section 10.7.5
  • The video-streaming service and gateway forward the response stream to their own HTTP responses. section 10.7.5
  • The browser’s video element initiates the request that receives the streamed video. section 10.7.5
Figure 10.11 The path of streaming video through FlixTube

Trace the video’s route from storage through the microservices to the frontend. section 10.7.5

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

How deep it goes
Explains readable streams and piping, then stops short of stream internals.
Examples
Uses a local video file, Azure Storage, forwarding services, and a browser video element.
What you can do after
Build from scratch a basic Express endpoint that streams a local video file to an HTTP response.
How it connects
Connects Node.js streams with Express, HTTP responses, Azure Storage, and microservices.

Also explained in

Compare how 19 books explain streaming →

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.