Node.js / NestJS

Microservices

Monolith vs modular monolith vs microservices, message patterns, transporters (TCP, Redis, NATS, RabbitMQ, Kafka), communication (sync/async, event-driven), CQRS, event sourcing, client/server

30 питань зі співбесід·
Senior
1

What is a modular monolith?

Відповідь

A modular monolith is an application deployed as a single unit but structured into strongly decoupled modules with clear boundaries. Unlike a classic monolith where everything is mixed, the modular monolith organizes code into independent modules that communicate via well-defined interfaces. This approach combines monolith simplicity (single deployment, simple ACID transactions) with microservices maintainability (separation of concerns, clear boundaries).

2

What is the main difference between a monolith and microservices?

Відповідь

The main difference lies in deployment and independence: a monolith is deployed as a single unit where all components share the same process and database, while microservices are independent services deployed separately with their own databases. Monoliths offer simplicity and easy ACID transactions but face scalability and maintenance issues at scale. Microservices enable independent scaling and autonomous deployments but introduce distributed complexity.

3

What is a message pattern in NestJS Microservices?

Відповідь

A message pattern in NestJS defines the communication mode between microservices. There are two main types: request-response (synchronous with expected response) and event-based (asynchronous without response waiting). The @MessagePattern() decorator defines a handler for request-response, while @EventPattern() handles asynchronous events. Pattern choice depends on use case: request-response for operations requiring immediate response, event-based for notifications and eventual consistency.

4

What is the role of a transporter in NestJS Microservices?

5

What is the difference between @MessagePattern() and @EventPattern()?

+27 питань зі співбесід

Опануй Node.js / NestJS для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно