Chapter 9. Microservices
Using Nest.js microservices, we are able to extract out part of our application’s business logic and execute it within a separate Nest.js context. By default, this new Nest.js context does not execute in a new thread or even a new process. For this reason, the name “microservices” is a bit misleading. In fact, if you stick with the default TCP transport, users may find that requests take longer to complete. However, there are benefits to offloading some pieces of your application to this new microservice context. To cover the basics, we will stick with the TCP transport, but look for some real-world strategies where Nest.js microservices can improve application performance in the Advanced Architecture section of this chapter. To see a working example, remember you can clone the accompanying Git repository for this book:
git clone https://github.com/backstopmedia/nest-book-example.git