
Our Blog
Explore our blog posts on web design, development, and digital marketing to stay up-to-date with the latest trends and strategies.
Found 112 blog posts
Postgres LISTEN/NOTIFY in Node.js and NestJS: How We Invalidate Caches Across Replicas Without Losing Notifications on Reconnect
PostgreSQL LISTEN/NOTIFY gives Node.js apps a transactional, zero-infrastructure signal that fires only when a write commits. Here is how we use it to invalidate in-memory caches across NestJS replicas: a trigger that calls pg_notify, a dedicated listener connection that survives reconnects, and the limits that tell us when to switch to Redis or CDC.
Postgres Transaction Isolation Levels from Node.js: Write Skew, SERIALIZABLE, and Retrying 40001
PostgreSQL defaults to READ COMMITTED, which lets two concurrent requests each pass a check and together break an invariant. This is how our team chooses between a constraint, an atomic UPDATE, a parent-row lock, and SERIALIZABLE, and how we retry SQLSTATE 40001 safely from Node.js.
JSONB in Postgres from Node.js: How We Index It with GIN, jsonb_path_ops, and Expression Indexes — Field Notes
A GIN index on a jsonb column only serves containment and key-existence operators, so a ->> equality filter quietly scans the table. Here is how our team decides what goes into jsonb, picks between jsonb_ops and jsonb_path_ops, uses expression indexes and STORED generated columns, and handles what node-postgres does to JSON arrays and large numbers.
Node.js Event Loop Blocking in NestJS: How We Measure Lag and Offload CPU Work to worker_threads with Piscina
One synchronous CPU-heavy call stalls every request on a Node.js process. We share how our team measures event loop lag with monitorEventLoopDelay() and eventLoopUtilization(), when the async core API is enough, and how we run CPU-bound work in a bounded Piscina worker pool inside NestJS.
Next.js after() in Production: Post-Response Work, the Static-Page Build-Time Trap, and When We Use a Queue Instead
Next.js after() moves analytics, audit logs, and cache work out of the response path, but it is not a job queue. Here is where we call after(), why it runs at build time on static pages, why cookies() throws inside it in Server Components, and when we use a durable queue instead.
Node.js Keep-Alive Timeouts Behind a Load Balancer: How We Stop Random 502s in NestJS
Random 502s from a load balancer in front of a healthy Node.js API usually trace back to one default: http.Server.keepAliveTimeout is 5 seconds, far below the 60-second idle timeout of an AWS ALB or an Nginx upstream. Here is how our team lines up keep-alive timeouts on every hop in NestJS, in Nginx, and for outbound fetch calls.
Streaming Large CSV Exports from Postgres in Node.js and NestJS: Backpressure, pipeline(), and the Connection a Slow Download Holds
A CSV export that loads every row into memory works in staging and fails in production. Here is how our team streams exports from Postgres with pg-query-stream and pipeline() in NestJS, how backpressure keeps memory flat, and the costs streaming adds: errors after the first byte, a held database connection, proxy buffering, and CSV injection.
Postgres Advisory Locks in Node.js and NestJS: How We Run Cron Jobs on Exactly One Replica
When a NestJS API scales to two replicas, every @Cron job runs twice. We use a Postgres advisory lock, not Redis, to keep scheduled jobs on one replica: the pg_try_advisory_xact_lock pattern we use with node-postgres, why session-level locks break behind PgBouncer, Neon, and Supabase poolers, and where fencing tokens still matter.
Structured Logging in Node.js and NestJS with Pino 10: How We Add Request IDs, Redact Secrets, and Keep Error Stacks
Our Node.js logs were strings we could grep but not query, and one request's lines mixed with everyone else's. We moved our Node.js and NestJS services to Pino 10 structured JSON logs. Here is how we attach a request ID to every line with AsyncLocalStorage, redact the request headers pino-http logs by default, and avoid the argument-order mistake that drops error stacks.
Vitest Browser Mode for React Component Tests: Why We Moved Off jsdom, and the Mocks That Broke
Our jsdom component tests passed while dropdowns rendered off-screen and buttons hid under sticky footers. We moved layout-, focus- and input-dependent React tests to Vitest Browser Mode with the Playwright provider and kept pure logic in Node. Here is our config, the test-code changes, and the four mocks that broke.
Running Parallel AI Coding Agents with Git Worktrees: How We Isolate Checkouts, Ports, Databases and Merges
When we run several AI coding agents against one repository, git worktrees isolate their files with one command, but ports, localhost cookies, databases and migrations still collide. This is the setup script, directory layout and merge routine our team uses.
Dark Mode Without the Flash in Next.js 16: How We Ship a Blocking Theme Script, color-scheme, and a Hydration-Safe Toggle
Dark mode that flashes white on reload is a timing bug: the server cannot read localStorage. We explain the blocking theme script we use in Next.js 16, why we keep the theme out of cookies to preserve static rendering, and how we build a toggle that hydrates without mismatches.
Stay Updated
Subscribe to our newsletter for the latest insights on web design, development, and digital marketing.