Stream: A sequence of values emitted over time. A stream of click events, a stream of price updates, a stream of HTTP responses — all can be processed with the same operators. A stream is a sequence of values that arrive over time, rather than all at once. Click events, live price updates, lines in a growing log file and chunks of a large download are all streams.
The advantage is that you can process each value as it arrives, without waiting for or storing the whole set. That keeps memory use low and lets interfaces respond immediately.
What should you keep in mind with Stream?
Streams appear at every level. Reactive libraries like RxJS treat events as streams with operators for filtering and combining. Node.js and PHP have streams for files and network data. Laravel's lazy collections and streamed responses let you export millions of rows without running out of memory. When data is large or never-ending, thinking in streams is usually the right approach.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.
Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.