LESSON 17 / 18·2 min readIntermediate

What are WebSockets, microservices and CQRS used for?

Try code in the playground
01 Understand02 Recall03 Prepare

Understand the concept

WebSockets maintain a two-way connection for ongoing messages, microservices split an application into separately operated services, and CQRS separates command/write handling from query/read handling. These solve different problems and can be used independently. Each adds complexity that should be justified by a concrete requirement.

Important ideas

  • WebSockets allow ongoing two-way updates, such as chat.

  • Microservices separate deployable services but add network and operational complexity.

  • CQRS separates read and write logic; it does not require separate databases.

  • CQRS can begin with separate code paths in one application and one database; event sourcing is a separate decision.

PAUSE & RECALL

Can you explain it without the notes?

What are WebSockets, microservices and CQRS used for?

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

WebSockets maintain a two-way connection for ongoing messages, microservices split an application into separately operated services, and CQRS separates command/write handling from query/read handling. These solve different problems and can be used independently. Each adds complexity that should be justified by a concrete requirement.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

  • Describe the user or scaling need before proposing WebSockets, distributed services or CQRS.
Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: How do I test and deploy a Nest app?

Adapted from 03_NESTJS.md · “What are WebSockets, microservices and CQRS used for?”. Examples are study fragments; framework behavior can depend on your version.