Recall & Review
beginner
What is load balancing between workers in Node.js?
Load balancing between workers means distributing incoming tasks or requests evenly across multiple worker processes to improve performance and reliability.
Click to reveal answer
beginner
Which Node.js module helps create worker processes for load balancing?
The 'cluster' module allows Node.js to create multiple worker processes that share the same server port, enabling load balancing.
Click to reveal answer
intermediate
How does the Node.js cluster module distribute incoming connections by default?
By default, the cluster module uses a round-robin approach on most platforms, sending each new connection to the next available worker in order.
Click to reveal answer
beginner
Why is load balancing important when using multiple workers?
Load balancing prevents any single worker from becoming overloaded, which helps keep the app responsive and stable under heavy traffic.
Click to reveal answer
intermediate
What happens if a worker crashes in a Node.js cluster setup?
The master process can detect the crash and spawn a new worker to replace it, maintaining the load balancing and availability.
Click to reveal answer
Which Node.js module is commonly used for load balancing between workers?
✗ Incorrect
The 'cluster' module is designed to create worker processes and balance load between them.
What load balancing method does Node.js cluster use by default on most platforms?
✗ Incorrect
Node.js cluster uses round-robin to distribute connections evenly among workers.
Why should you use multiple workers in a Node.js app?
✗ Incorrect
Multiple workers allow Node.js to use multiple CPU cores, improving performance.
What does the master process do if a worker crashes?
✗ Incorrect
The master process can detect worker crashes and create new workers to keep the app running.
Which of these is NOT a benefit of load balancing between workers?
✗ Incorrect
Load balancing reduces single points of failure by spreading work across workers.
Explain how the Node.js cluster module helps with load balancing between workers.
Think about how Node.js handles multiple requests using workers.
You got /5 concepts.
Describe what happens when a worker process crashes in a Node.js cluster setup and how the system recovers.
Consider fault tolerance and worker lifecycle.
You got /5 concepts.