wtf( )unctionsystem design, drawn
← all problemsAPI DesignMedium

Sending the same payload sixty times an hour

A dashboard polls an endpoint every minute. The data changes a few times a day, so almost every response is a full payload identical to the last one — bytes on the wire, work in the database, and nothing new for the user.

The client has no way to say "only if it changed", because the server never told it what version it already has.

Let an unchanged response cost almost nothing.
Components — tap one, then tap a slot on the diagram
!A dashboard pulls a full identical payload every minute, all day.

Outside every boundary: API (rebuilds it each time; FAILED: full payload), Dashboard (polls every minute), an empty slot for the on response and request Connections: Dashboard calls on response and request — I have version X (step 1) on response and request calls API (step 2) API calls Dashboard — not modified (step 3)

APIrebuilds it each timefull payload
Dashboardpolls every minute