Blog

Coding

Practical Node.js API engineering: Express and Fastify patterns, validation, timeouts, uploads, pagination, idempotency and graceful shutdown, with code you can ship.

Node.js large file upload, no OOM. Cover graphic for a guide to streaming large uploads in Node.js without running out of memory.
Coding

Node.js large file upload handling without running out of memory

One 2 GB upload should not take your API down with it. Here is how to stream uploads in Express and Fastify, when to use presigned URLs, and which parsers to patch.

Jason Fill October 5, 2026 6 min read
Cursor vs offset pagination at page 4000. Cover graphic for a guide to keyset pagination in Node.js and Postgres APIs.
Coding

Cursor vs offset pagination: an API design that survives big tables and scrapers

Offset pagination was fast at launch; now deep pages hammer the database and one API key is walking every page. Here is when to switch to cursors and how.

Jason Fill August 21, 2026 6 min read
Zod validation, before the 500. Cover graphic for a guide to validating request bodies and query strings with Zod in Express and Fastify.
Coding

Zod validation in Express and Fastify: request bodies, query strings and useful errors

A null where your handler expected an array becomes a 500 and a support ticket. Validate bodies, query strings and params with Zod 4 in Express 5 and Fastify 5, return 400s clients can act on, and stop extra fields at the door.

Jason Fill July 17, 2026 6 min read
Idempotency keys stop double charges. Cover graphic for a guide to making POST retries safe with idempotency keys in Node.js and Postgres.
Coding

Idempotency keys in Node.js: safe retries for POST endpoints without double charges

A timeout, an automatic retry, and a customer charged twice. Idempotency keys make POST retries safe: here is a working Express and Postgres implementation, the status codes to return, and how long to keep keys.

Jason Fill June 3, 2026 7 min read
Fastify hooks: which one does what. Cover graphic for a guide to using Fastify onRequest, preHandler and onResponse hooks for auth and logging.
Coding

Fastify hooks for logging and auth: onRequest, preHandler and onResponse explained

Auth checks that run before the body exists, log lines missing the status code, handlers that run after a 401: most come from using the wrong Fastify hook. Here is which hook does which job in Fastify v5, with working code.

Jason Fill April 20, 2026 6 min read
Express 5 migration: what actually breaks. Cover graphic for a guide to upgrading an Express 4 API to Express 5 and fixing what breaks.
Coding

Express 5 migration: what breaks in your API and how to fix it

You bump Express to 5 and the app dies with "Missing parameter name", or worse, starts fine and quietly breaks pagination. Here is what the Express 5 migration actually breaks in an API and how to fix each one.

Jason Fill March 16, 2026 5 min read
Node.js fetch timeout, set properly. Cover graphic for a guide to setting Node.js fetch timeouts with AbortSignal and undici.
Coding

Node.js fetch timeout: deadlines with AbortSignal and undici

One slow vendor and every handler hangs, because Node fetch waits up to five minutes by default. Here is how to set deadlines with AbortSignal and undici in Express and Fastify.

Jason Fill February 9, 2026 6 min read
Node.js graceful shutdown, done right. Cover graphic for a guide to draining requests on SIGTERM in Express and Fastify.
Coding

Node.js graceful shutdown: stop dropping requests on every deploy

A burst of 502s on every deploy is usually the old process dying with requests in flight. Here is the shutdown order and Express and Fastify code that fixes it in an afternoon.

Jason Fill December 29, 2025 6 min read
AsyncLocalStorage request IDs on every line. Cover graphic for a guide to adding request IDs to Node.js logs with AsyncLocalStorage.
Coding

AsyncLocalStorage request IDs: follow one request through a Node.js API

A customer says checkout failed at 2pm and your logs are fifty requests interleaved. Add request IDs with AsyncLocalStorage in Express or Fastify in an afternoon, and every log line, response and downstream call carries the same ID.

Jason Fill November 24, 2025 6 min read