When to use Node.js "cluster" vs "worker thread"?

  Рет қаралды 45,341

Software Developer Diaries

Software Developer Diaries

Күн бұрын

Here is when to use the "cluster" module of Node.js and when to use the "worker threads".
======⚡⚡⚡======
Consider supporting the channel by clicking the "Thanks" button ❤️
👉 Get a 20% discount on Brilliant.org (to learn Science, Technology, Engineering, and Math): brilliant.sjv....
======⚡⚡⚡======
🙌 Become my Patreon and get exclusive perks: / softdevdiaries
💼 Follow me on LinkedIn and drop me a message if you'd like: / gusgadirov
💻 Also, let's connect on GitHub: github.com/gusgad
And don't forget to subscribe for more videos like this 😊
#shorts #programming #nodejs

Пікірлер: 22
@mooza.shorts
@mooza.shorts Жыл бұрын
Finally some advanced node content
@RajSekharK
@RajSekharK 11 ай бұрын
Waw. The section "when to use X" clearly explains how to do decision making. ❤ I subscribed to your channel, after this short.
@nhatnguyenhuu7822
@nhatnguyenhuu7822 Жыл бұрын
It's very useful for us! Thanks a lot and keep up your work!
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Happy to hear! 😊
@nagarjundeepak
@nagarjundeepak Жыл бұрын
great explanation. thanks
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
Glad it was helpful!
@Dinomight-zz6bp
@Dinomight-zz6bp 6 ай бұрын
Never heard of clusters before but that's exactly what I was looking to see if it was possible. Workers to manage collisions in a map and a cluster for each map.
@josephgay-cj2fc
@josephgay-cj2fc Жыл бұрын
What is the difference between the node cluster module and PM2 process manager? When would you use one over the other?
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
The Node.js cluster module allows you to create multiple child processes that share the same server port, distributing incoming connections among them. PM2, on the other hand, is a more comprehensive process manager that provides features like automatic restarts, load balancing, and monitoring for Node.js applications. Use the cluster module for simple load distribution, while PM2 is suitable for managing and scaling more complex applications with additional features.
@mosaeed3183
@mosaeed3183 Жыл бұрын
pm2 actually uses the node.js cluster module under the hood.
@muhammedhuzaifa1392
@muhammedhuzaifa1392 7 ай бұрын
can I use both first if I swpan thread then cluster my node js
@adhishankarit
@adhishankarit Жыл бұрын
Is there any data processing framework return using Node JS similar like Apache Spark
@Superuser-r1y
@Superuser-r1y Жыл бұрын
Hello sir can I use both cluster and worker threads in node js?? Because my node application uses ffmpeg for video processing that is a very Cpu intensive task.
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
You definitely can 😉
@Superuser-r1y
@Superuser-r1y Жыл бұрын
​@@SoftwareDeveloperDiaries ok sir thanks, ❤❤ from India 🇮🇳🇮🇳
@mUsIcAl_cHaOs95
@mUsIcAl_cHaOs95 4 ай бұрын
Forgive me for the Q.... How do we find out which one we r using😅
@Mae6e
@Mae6e Жыл бұрын
I have a crypto currency node js project, that I check blocks for multi networks to update user balances for deposit. I want ti: if the server off then restarting it then check handreds block in the networks. and allocate all to parallel tasks. How can implement that for parallel and multi processing? explain for it. thaks
@olhoTron
@olhoTron 11 ай бұрын
Go programmers: "look what they need to mimic a fraction of our power"
@themaridv2000
@themaridv2000 7 ай бұрын
FOR REAL. But node has more work demand 😢
@Md.NowshadIslam-l4v
@Md.NowshadIslam-l4v 4 ай бұрын
@@themaridv2000 you gotta remember that node.js performs best at I/O tasks and it was created keeping that in mind
@gaetanguiffo9378
@gaetanguiffo9378 Жыл бұрын
Is worker the way to go if i have to connect my application to send traffic on many serial port ar same time ?
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Жыл бұрын
It could be an option, yes :)
Mastering Memory Management in Node.js: Tips and Tricks for Better Performance
16:06
Software Developer Diaries
Рет қаралды 42 М.
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 300 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Why aren't you using Fastify? Or Koa? Or NestJS?
9:58
Maximilian Schwarzmüller
Рет қаралды 77 М.
Node.js Tutorial - 62 - Worker Threads Module
6:33
Codevolution
Рет қаралды 46 М.
All you need to know about "child_process" in Node.js
12:38
Software Developer Diaries
Рет қаралды 11 М.
Express JS vs Node JS - Which One Should You Choose?
4:33
ProCoders: Web & Apps developement
Рет қаралды 2,3 М.
Concurrency vs Parallelism in Node.js
7:47
Mehul - Codedamn
Рет қаралды 45 М.
When is NodeJS Single-Threaded and when is it Multi-Threaded?
18:42
Hussein Nasser
Рет қаралды 75 М.
How to use Multithreading with "worker threads" in Node.js?
19:34
Software Developer Diaries
Рет қаралды 82 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.