This is the rapid-fire revision sheet for the Node.js notes.
Node.js is a JavaScript runtime built on V8 and libuv, designed for event-driven, non-blocking I/O workloads.
Because it avoids thread-per-request overhead and handles async I/O efficiently through the event loop and runtime support.
It is the runtime mechanism that schedules queued callbacks and async completions onto the main execution flow.
The library that powers Node's event loop, async I/O abstractions, and thread pool.
Callbacks are the older style, promises improve composition, and async/await makes promise-based code easier to read.
They let Node process large data incrementally, reducing memory pressure.
Because it blocks the main JavaScript thread and delays all other work.
CommonJS uses require and module.exports. ES Modules use import and export and are the modern standard syntax.
Because repeated imports usually return the same module instance, which affects shared state.
Choose based on relationships, transactions, schema control, and access patterns.
Mongoose is for MongoDB document modeling. Sequelize is for relational databases and table-based associations.
When the workload is dominated by CPU-bound computation on the main thread.
Avoid sync APIs, stream large data, and move CPU-heavy work to worker threads or other services.