Recall & Review
beginner
What is the main purpose of using a cluster in Node.js?
A cluster allows a Node.js application to use multiple CPU cores by creating child processes that share the same server port, improving performance and reliability.
Click to reveal answer
beginner
What role does a reverse proxy play in a web application setup?
A reverse proxy sits in front of web servers, forwarding client requests to them. It can handle load balancing, SSL termination, caching, and security filtering.
Click to reveal answer
intermediate
When should you choose a cluster over a reverse proxy in Node.js?
Choose a cluster when you want to maximize CPU usage within a single machine by running multiple Node.js processes to handle requests concurrently.
Click to reveal answer
intermediate
Why might you use a reverse proxy instead of a cluster for scaling?
A reverse proxy can distribute traffic across multiple servers or services, not just processes on one machine, enabling horizontal scaling and better fault tolerance.
Click to reveal answer
advanced
Can clusters and reverse proxies be used together? Explain.
Yes, clusters can be used to utilize multiple CPU cores on a single server, while a reverse proxy can distribute traffic across multiple servers running clusters, combining vertical and horizontal scaling.
Click to reveal answer
What does a Node.js cluster primarily help with?
✗ Incorrect
Clusters create child processes to use multiple CPU cores on a single machine.
Which of these is NOT a typical function of a reverse proxy?
✗ Incorrect
Running multiple Node.js processes is done by clustering, not by a reverse proxy.
If you want to scale your app across multiple servers, what should you use?
✗ Incorrect
A reverse proxy can distribute traffic across multiple servers for horizontal scaling.
Which setup improves CPU usage on a single machine?
✗ Incorrect
Clusters create multiple processes to use all CPU cores on one machine.
What is a benefit of combining clusters with a reverse proxy?
✗ Incorrect
Clusters handle multiple cores on one server (vertical scaling), reverse proxies distribute traffic across servers (horizontal scaling).
Explain the differences between a Node.js cluster and a reverse proxy and when to use each.
Think about how each helps handle more requests and where they fit in the system.
You got /5 concepts.
Describe a scenario where using both a cluster and a reverse proxy together makes sense.
Imagine a busy website running on several servers, each using clusters.
You got /5 concepts.