Reader small image

You're reading from  Nest.js: A Progressive Node.js Framework

Product typeBook
Published inNov 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781800204737
Edition1st Edition
Languages
Tools
Right arrow
Authors (5):
Greg Magolan
Greg Magolan
author image
Greg Magolan

Greg Magolan is a senior architect, full-stack engineer, and Angular consultant at Rangle. He has been developing enterprise software solutions for over 15 years for companies such as Agilent Technologies, Electronic Arts, Avigilon, Energy Transfer Partners, FunnelEnvy, Yodel and ACM Facility Safety.
Read more about Greg Magolan

Patrick Housley
Patrick Housley
author image
Patrick Housley

Patrick Housley is a lead technologist at VML. He is an IT professional with over six years of experience in the technology industry. He is capable of analyzing complex issues spanning multiple technologies while providing detailed resolutions and explanations. He has strong front-end development skills with experience leading development teams in maintenance and greenfield projects.
Read more about Patrick Housley

Adrien de Peretti
Adrien de Peretti
author image
Adrien de Peretti

Adrien de Peretti is a full-stack JavaScript developer. He is passionate about new technologies and is constantly looking for new challenges. He is especially interested in artificial intelligence and robotics. W
Read more about Adrien de Peretti

Jay Bell
Jay Bell
author image
Jay Bell

Jay Bell is the CTO of Trellis. He is a senior Angular developer who uses Nest.js in production to develop industry-leading software to help non-profit organizations and charities in Canada. He is a serial entrepreneur who has developed software for a large range of purposes, from helping combat wildfires with drones to building mobile apps.
Read more about Jay Bell

David Guijarro
David Guijarro
author image
David Guijarro

David Guijarro is a front-end developer at Car2go Group GmbH. He has a wide experience working within the JavaScript ecosystem. He has successfully built and led multicultural, multifunctional teams.
Read more about David Guijarro

View More author details
Right arrow

Advanced architecture design

So far we have covered everything needed to setup and start writing and using microservices in Nest.js. Along the way we describe some of the drawbacks Nest.js’ implementation of microservices has. Most notably, since the microservices does not run in a separate thread or process, you may not be gaining much in the way of performance when using Nest.js microservices.

However, that is not to say you can’t get these benefits. Nest.js just doesn’t provide the tools out of the box. In most material found on the subject of running a NodeJS application in production, the one thing that is typically always covered and recommended is the use of the NodeJS cluster module. We can do the same thing with our Nest.js application.

async function bootstrapApp() {
    const app = await NestFactory.create(AppModule);

    await app.listen(process.env.PORT || 3000);
}

async function bootstrapRpc() {
    const rpcApp = await NestFactory.createMicroservice...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Nest.js: A Progressive Node.js Framework
Published in: Nov 2019Publisher: PacktISBN-13: 9781800204737

Authors (5)

author image
Greg Magolan

Greg Magolan is a senior architect, full-stack engineer, and Angular consultant at Rangle. He has been developing enterprise software solutions for over 15 years for companies such as Agilent Technologies, Electronic Arts, Avigilon, Energy Transfer Partners, FunnelEnvy, Yodel and ACM Facility Safety.
Read more about Greg Magolan

author image
Patrick Housley

Patrick Housley is a lead technologist at VML. He is an IT professional with over six years of experience in the technology industry. He is capable of analyzing complex issues spanning multiple technologies while providing detailed resolutions and explanations. He has strong front-end development skills with experience leading development teams in maintenance and greenfield projects.
Read more about Patrick Housley

author image
Adrien de Peretti

Adrien de Peretti is a full-stack JavaScript developer. He is passionate about new technologies and is constantly looking for new challenges. He is especially interested in artificial intelligence and robotics. W
Read more about Adrien de Peretti

author image
Jay Bell

Jay Bell is the CTO of Trellis. He is a senior Angular developer who uses Nest.js in production to develop industry-leading software to help non-profit organizations and charities in Canada. He is a serial entrepreneur who has developed software for a large range of purposes, from helping combat wildfires with drones to building mobile apps.
Read more about Jay Bell

author image
David Guijarro

David Guijarro is a front-end developer at Car2go Group GmbH. He has a wide experience working within the JavaScript ecosystem. He has successfully built and led multicultural, multifunctional teams.
Read more about David Guijarro