Bird
0
0

Given this setup: a Node.js app uses a cluster with 4 workers and a reverse proxy in front. What is the main benefit of this combination?

medium📝 component behavior Q13 of 15
Node.js - Cluster Module
Given this setup: a Node.js app uses a cluster with 4 workers and a reverse proxy in front. What is the main benefit of this combination?
AThe cluster manages security, and the reverse proxy manages CPU usage
BThe cluster handles SSL termination, and the reverse proxy creates workers
CThe reverse proxy caches data, and the cluster forwards requests
DThe reverse proxy balances traffic, and the cluster uses all CPU cores
Step-by-Step Solution
Solution:
  1. Step 1: Understand roles of cluster and reverse proxy

    The cluster allows Node.js to use multiple CPU cores by creating workers. The reverse proxy balances incoming traffic among servers.
  2. Step 2: Eliminate incorrect roles

    SSL termination and security are usually handled by reverse proxies, not clusters. Clusters do not forward requests or cache data.
  3. Final Answer:

    The reverse proxy balances traffic, and the cluster uses all CPU cores -> Option D
  4. Quick Check:

    Cluster = CPU cores, Reverse proxy = traffic balance [OK]
Quick Trick: Cluster for CPU, reverse proxy for traffic control [OK]
Common Mistakes:
  • Swapping roles of cluster and reverse proxy
  • Thinking cluster handles SSL or security
  • Assuming reverse proxy creates workers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes