#Node.js
17 articles — newest first.
- 8 min read
Worker threads in Node, and the pool you actually need
CPU-bound work blocks every request, not just its own. When a worker thread is the right tool over a child process or a queue, why a pool beats spawning per task, and what the copy costs.
- 8 min read
Parsing high-throughput text streams in Node without falling behind
Line-delimited protocols at thousands of messages a second: why split on every chunk is the bottleneck, handling messages that straddle a chunk boundary, and staying on buffers until the last moment.
- 8 min read
Keeping a long-running Node process flat for twelve hours
Short-lived scripts forgive everything. A process that runs all day does not. Allocation churn, buffer reuse, the caches you forgot were caches, and reading V8 heap statistics without guessing.
- 7 min read
Polling versus events for Node background work
A setInterval that finds nothing to do is not free. When polling is the right answer anyway, how to make it cheap, and the overlap bug that turns a five-second poll into a pile-up.
- 8 min read
Caching in Node: in-process, Redis, and the cost of both
A two-layer cache is fast until one instance serves stale data forever. Bounded in-process caches, when Redis earns its hop, stampede protection, and invalidation that actually invalidates.
- 8 min read
MongoDB migrations that do not lock production
Schemaless does not mean migration-free. Versioned documents, expand-and-contract rollouts, background indexes, and backfills that can be paused halfway.
- 8 min read
Structured concurrency in Node with AbortController
Promise.all is not concurrency control. Bounding parallelism, cancelling siblings when one fails, and making sure nothing outlives the request that started it.
- 8 min read
Profiling a React app from request to paint
A slow interaction has four possible homes: the network, the server, hydration, or your render. Reading the Performance panel and the React Profiler together tells you which one, before you optimise the wrong thing.
- 8 min read
Backpressure in Node, or why your queue ate all the memory
An unbounded queue is a memory leak with a scheduler. How Node streams signal backpressure, why pipeline beats pipe, and what to do when the producer genuinely cannot slow down.
- 7 min read
Faster JSON on Node hot paths, and when it is worth it
JSON.parse and JSON.stringify are fast until they are your bottleneck. Where the time actually goes, what fast-json-stringify and simdjson buy you, and how to avoid parsing at all.
- 8 min read
Encrypting data at rest in a Node app without inventing crypto
Field-level encryption in Node with the built-in crypto module: AES-GCM, where the key actually lives, key rotation that does not require downtime, and what encryption at rest does not protect you from.
- 8 min read
Finding event-loop stalls in Node before your users do
Async code that never resumes, and sync work that blocks everything else, look identical from outside. Event-loop delay monitoring, async hooks and a stall detector tell them apart.
- 8 min read
A WebSocket reconnect state machine for React and Node
Reconnection logic written as ad-hoc flags always breaks. An explicit state machine with backoff, jitter and heartbeats survives flaky networks and server restarts.
- 8 min read
Halving WebSocket payloads with MessagePack in Node and React
Where JSON over WebSockets actually costs you, what MessagePack does and does not fix, and how to batch high-frequency events so the wire is not the bottleneck.
- 7 min read
A reproducible memory-regression workflow for Node
Catching Node memory regressions before production: a repeatable load script, three heap snapshots, and reading retainer paths instead of guessing at the biggest object.
- 8 min read
Unifying Twitch and YouTube Live Chat: Ordered, De-duplicated
Build a single, ordered, de-duplicated event stream from Twitch IRC and YouTube Live Chat with Hybrid Logical Clocks, watermarks, and idempotent delivery.
- 7 min read
Everyone Said 'Just Go Serverless.' I Ran a Long-Lived Node Process — Here's What That Bought
A live dashboard holding thousands of open connections is the one workload serverless is worst at. Why in-process state, loop-based fan-out and real backpressure were the product decision, not a preference.