What is the difference between monolithic and microservices architecture in Node.js?
Why Interviewers Ask This
Candidates at the intermediate level are expected to not only know this concept but explain the trade-offs involved. Interviewers use this question to see if you can reason about design decisions, not just recall facts.
Answer
A monolithic architecture packages all application functionality (auth, billing, notifications, user management) as a single deployable unit running in one process. Simpler to develop, test, and deploy initially; easier to debug (single log stream, single codebase); no network overhead between components. Drawbacks: as the app grows, it becomes harder to scale specific bottlenecks (must scale everything), slower deployments, technology lock-in, and risk of tight coupling. A microservices architecture decomposes the application into small, independently deployable services, each responsible for a single business capability. Each service has its own codebase, database, and deployment pipeline. Benefits: independent scaling, technology diversity (mix Node.js, Python, Go), isolated failures, parallel team development. Drawbacks: network latency between services, distributed transaction complexity, operational overhead (container orchestration, service discovery, monitoring). For Node.js, frameworks like NestJS and tools like gRPC, RabbitMQ, Apache Kafka, and Docker/Kubernetes support microservices. Start monolithic — migrate to microservices when clear bottlenecks or team scaling demands it.
Common Mistake
Don't just define the term — demonstrate that you understand when to use it and when not to. Showing awareness of trade-offs is what separates average from strong Node.js candidates.
Previous
What is WebSocket and how do you implement it in Node.js?
Next
What is a message queue and why is it used in Node.js applications?