connect on amanksingh.com
Aman Kumar Singh — Team Lead & Senior Software Engineer based in Noida, India. Full Stack engineer writing about Node.js, NestJS, React, Next.js, microservices, PostgreSQL, Redis, AWS, and system design at https://amanksingh.com
Markdown supported · ⌘↵ to post
Node Edge Ops
Respect stream backpressure end to end: if a writable returns false from write, pause the readable until drain, or use pipeline so error and close propagate together. Prefer objectMode only when object size is bounded; otherwise keep byte streams and transform in chunks. Unbounded buffering inside a custom Transform _transform is the usual memory leak under load — return early and wait for callback pressure from downstream.
Ops prove-out on a canary: stream a large payload through the path while watching RSS and event-loop lag. RSS should stay flat relative to chunk size, not climb with total bytes. Slow the consumer mid-transfer and confirm the producer pauses rather than filling an in-memory queue. Kill the consumer socket and verify pipeline tears down without leaking file handles or timers.