Ga naar de hoofdinhoud

Budget the expensive export

Design layered resource controls for an expensive API export endpoint.

api-security5 min read

POST /events/export lets tenant admins export arbitrary date ranges synchronously. Request validation -> cost estimate -> tenant budget -> async execution -> dedupe and monitoring A route-level request limit is not enough when each allowed request can start minutes of database and queue work. Bound the request Allow date ranges up to 31 days, require filters, and reject unsupported formats before starting the query. Input limits prevent impossible or accidental work from entering the expensive path. Estimate cost Run a cheap count estimate and reject or split jobs above 500k rows. The system should know approximate cost before allocating long-running…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Neem contact op