buffer
A region of memory that holds data temporarily while it is being moved or collected.
In more detail
Buffers smooth out differences in speed between the part producing data and the part consuming it. Buffering a whole response before processing needs memory for all of it; streaming processes each chunk and discards it.
Related terms
- streaming — Sending a response in pieces as they become available instead of building the whole thing first.
- ArrayBuffer — A standard JavaScript object representing a block of raw binary memory, which you read and write through a typed array or DataView.
- message queue — A store that holds messages from producers until consumers are ready to process them, decoupling the rate of arrival from the rate of work.
- backpressure — A slow consumer signalling a fast producer to pause, so data does not pile up in memory faster than it can be handled.
- bounded queue — A waiting line for tasks with a maximum size, so that when it is full new work is rejected instead of piling up in memory.
Taught in
- The Fetch API: Streaming Responses, HTTP Caching And Keepalive — Frontend Architecture & Web Platform
- Caching Strategies And Topology — Scalable System Design & Distributed Architecture
- Queues, Events And Asynchronous Work — Scalable System Design & Distributed Architecture
- Backpressure And Load Shedding — Scalable System Design & Distributed Architecture
- Worked Design Three: A Metrics Ingestion Pipeline — Scalable System Design & Distributed Architecture