Bound API Work, Memory, and Downstream Cost
Budget body sizes, batches, pagination, workers, response bytes, deadlines, and paid provider operations before allocating work.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
Count the work behind one request
A request counter measures arrivals. It does not automatically measure database scans, decompressed bytes, workers, outbound calls, or billable provider operations. An API needs limits on the resources its accepted operations can consume.
RateCompare accepts a JSON list of quote URLs, starts a fetch for each, and reads the responses into memory. Two URLs are ordinary; fifty thousand change the work multiplier. A single enormous response changes memory cost. A slow destination changes how long connections and workers remain occupied.
{ "quote_urls": ["https://vendor.example.test/a", "https://vendor.example.test/b"] }