Backpressure in Spring Boot's reactive stack is handled through the Reactive Streams specification, where a subscriber explicitly signals how many items it can process, preventing a fast publisher from overwhelming a slower consumer.
Key Points: • The subscriber calls request(n) to pull a bounded number of items rather than the publisher pushing unlimited data. • Operators like onBackpressureBuffer, onBackpressureDrop, and onBackpressureLatest let developers choose how excess data is handled. • WebFlux's non-blocking I/O model means threads aren't held waiting, so backpressure works naturally across the whole pipeline. • Backpressure prevents OutOfMemoryError conditions that can occur when a fast producer floods a slow consumer's buffer. • Reactor's Flux and Mono both honor backpressure signals end-to-end through composed operator chains.
Example: A Flux emitting database rows faster than a downstream file writer can consume them will pause emission until the writer requests more items, rather than piling up unbounded rows in memory.
Interview Tip: A concise interview answer is:
"Reactive streams handle backpressure by letting the subscriber request a specific number of items rather than the publisher pushing everything at once. In WebFlux this flows through the whole non-blocking pipeline, so a slow consumer naturally throttles a fast producer instead of risking memory exhaustion."