liveBook · Manning

Server streaming

As explained in Build High Value Software Systems

Server-side streaming is the incremental transmission of generated data from a server to a client rather than buffering the complete result.

Server streaming sends generated data incrementally instead of buffering the complete result. For a CSV export, the server can read orders in bounded batches or through a cursor and write rows directly to the HTTP response, avoiding a full dataset in memory. section 4.1.4

Listing 4.4 Spec file
Accept: GET /api/orders/export (authenticated user)
Return: CSV file with columns: order_id, date, total, status
Filter: Only orders belonging to the requesting user
Format: Standard CSV, UTF-8 encoding
Never: Include other users' data, build the CSV in the browser, load all orders into memory, allow unauthenticated access
Prefer: Stream CSV rows from the server using bounded database reads

The export spec makes streaming a design constraint: read bounded amounts from the database and never load all orders into memory. section 4.1.4

How Build High Value Software Systems covers it

How deep it goes
Specifies bounded database reads and incremental HTTP writes, without detailing implementation code.
Examples
Uses an authenticated order-export endpoint producing CSV, including for users with 10,000 or more orders.
What you can do after
Evaluate an export implementation against requirements for bounded reads, privacy, and server-side CSV generation.
How it connects
Connects CSV export with database cursors, bounded reads, and HTTP responses.

Also explained in

Compare how 2 books explain server streaming →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.