DEV Community

Cover image for NestJS vs. Express: Which Framework to Choose for Your Next Project?

NestJS vs. Express: Which Framework to Choose for Your Next Project?

Murat Can Yüksel on March 18, 2023

To learn more about programming, subscribe to my Youtube channel => https://www.youtube.com/channel/UCP1hJydcsPZCwbn8rPiohsg NestJS ...
Collapse
 
alnadzmerjmail profile image
AlnadzmerJmail

NestJS, on the other hand, uses a multi-threaded architecture that allows it to handle a large number of concurrent connections without blocking the event loop.

-- What do you mean of this multi-threaded architecture?

-- The statement "NestJS uses a multi-threaded architecture" is incorrect. NestJS does not use multi-threading at all. It uses a single-threaded event-driven architecture, which is the same architecture used by Node.js.

The author of the statement may have been referring to the fact that NestJS uses a technique called "worker threads" to offload CPU-intensive tasks. Worker threads are lightweight processes that can be used to run code in parallel to the main thread. This can improve the performance of NestJS applications that have to perform a lot of CPU-intensive tasks.

However, worker threads are not the same as multi-threading. Multi-threading is a technique that allows multiple threads to run concurrently on the same CPU core. This can improve the performance of applications that have to perform a lot of I/O operations. However, multi-threading can also introduce some complexity and overhead.

NestJS does not use multi-threading because it is not necessary for most applications. Node.js's single-threaded event-driven architecture is well-suited for handling a large number of concurrent requests. And worker threads can be used to offload CPU-intensive tasks.

So, the statement "NestJS uses a multi-threaded architecture" is incorrect. NestJS uses a single-threaded event-driven architecture with worker threads.

Collapse
 
muratcanyuksel profile image
Murat Can Yüksel

thanks for the correction mate!

Collapse
 
squallstar profile image
Nicholas Valbusa • Edited

Well, the whole article is basically a copy-paste of a ChatGPT answer so it's not a surprise that most of the content is gibberish (just search for matches of "In conclusion" or "Ultimately," on this page). As an example, the article mentions that Nest.js is built on top of Fastify – which isn't correct, as it's built on top of Express – and that Express wouldn't be suitable for large scale applications, which is also incorrect Given Nest.js is built on top of it...

Collapse
 
muratcanyuksel profile image
Murat Can Yüksel

Yeah you got me, this was my attempt to see whether people would give attention to completely AI generated texts. And it did generate almost 19k views, while some of my other writings, such as dev.to/muratcanyuksel/web-automati... that shows direct, actionable advice without a single help from AI only gathered around 270 views. So, take what you want from this little experiment.

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hey, this article appears to have been generated with the assistance of ChatGPT.

We allow our community members to use AI assistance when writing articles as long as they abide by our guidelines. Could you review the guidelines and edit your post to add a disclaimer?

Failure to follow these guidelines could result in DEV admin lowering the score of your post, making it less visible to the rest of the community. Or, if upon review we find this post to be particularly harmful, we may decide to unpublish it completely.

We hope you understand and take care to follow our guidelines going forward!

Collapse
 
tylim88 profile image
Acid Coder