Node.js Event Loop: Microtasks, Timers and I/O
Reason about callback scheduling, blocking work and why timer delays are thresholds rather than guarantees.
ENGINEERING NOTES
Practical mental models, small code examples and quick revision for backend interviews and production problem-solving. These notes explain concepts and project patterns; they do not add employment claims.
Reason about callback scheduling, blocking work and why timer delays are thresholds rather than guarantees.
Understand captured bindings, block scope and initialization without relying on hoisting slogans.
Start independent work together, handle partial failure and distinguish fail-fast from cancellation.
Build a bounded worker loop and understand the difference between concurrency limits, rate limits and queue capacity.
Trace a request through ordered middleware, validation, routing and a safe centralized error boundary.
Place HTTP, business rules and SQL behind boundaries that support transactions and focused tests.
Separate identity, session renewal and resource access, including organisation-scoped authorization.
Connect atomic writes, query plans and pool capacity to application correctness and latency.
Treat cached data as disposable acceleration and make stale reads, failure and invalidation policies explicit.
Use scoped keys, authenticated webhooks and transaction boundaries to handle ambiguous delivery safely.
Close the dual-write gap without pretending a database commit guarantees exactly-once message delivery.
Place dependency wiring, authorization, validation and cross-cutting behavior at the right NestJS boundary.
A layer-by-layer checklist for scoping incidents, verifying recovery and documenting root cause.