From the course: Node.js: Microservices

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using queues for decoupling

Using queues for decoupling - Node.js Tutorial

From the course: Node.js: Microservices

Using queues for decoupling

- [Instructor] One goal in microservice architectures is to avoid tight coupling. It's hard to decouple actions that are needed to show data on the website instantly, but when it comes to posting data to a service in a file-and-forget way, doing that asynchronously through some intermediate service removes any dependency between caller and receiving service. Queues are a common way to accomplish that, and the basic principle is very simple. Basically, they provide a way to publish messages to it. In our shopper app, we store orders. Right now, the order functionality is still part of the monolith, but we will change that. When a customer clicks on Buy, there are several actions performed, and eventually an order is created. This is typically a file-and-forget call. I don't need any feedback by the order-service at this point. If you use a queue, these Create Order messages are stored in this queue regardless…

Contents