Blog
Posts tagged “Postgres”
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.
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.
Monitoring
How to find N+1 queries in a Node.js API before your users do
An endpoint that's fast in development takes 900 ms for your biggest customer because it runs 201 queries. Find N+1 queries in a Node API with a per-request query counter and a test, then fix them with one batched query.