All you need to know about "child_process" in Node.js

  Рет қаралды 10,651

Software Developer Diaries

Software Developer Diaries

Күн бұрын

Пікірлер: 22
@ofeklevy1242
@ofeklevy1242 9 ай бұрын
One of the best channels for learning advanced node-js and backend related stuff. BTW im waiting for the best practices for security in web apps. :)
@iqralatif145
@iqralatif145 Ай бұрын
Thanks!
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries Ай бұрын
Thanks for the tip, my friend! 🙌
@hanibal43
@hanibal43 9 ай бұрын
These are amazing videos! no one is doing deep dives in node.js love the video would like to see more practical uses of these like with small API project videos
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 9 ай бұрын
Thanks mate! I'll keep posting more of these then 😉
@yousafraza9347
@yousafraza9347 7 ай бұрын
Really love this methodology of deep diving a specific topic. Glad I found this channel
@alphonsoacqua
@alphonsoacqua 7 ай бұрын
Outstanding! Finally someone is making quality videos about advanced Node.js. Thank you. 🤝
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 7 ай бұрын
Thanks mate 😊!
@allatyurina6631
@allatyurina6631 3 ай бұрын
I really appreciate you for your videos! You are so great at explaining such complicated things. Many thanks!
@Yohannesalemu-k8w
@Yohannesalemu-k8w Ай бұрын
i understand know after warching 2 videos but this is clear and clear nice
@aliadel1723
@aliadel1723 5 ай бұрын
Best channel for nodejs
@NguyenNgoc-b3e
@NguyenNgoc-b3e 9 ай бұрын
I love your content man
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 9 ай бұрын
Happy to hear! 🫶
@headlights-go-up
@headlights-go-up 9 ай бұрын
love these types of videos! so much better than the superficial "build a twitter clone" videos that everyone else makes.
@LuisGutierrez-ct6iw
@LuisGutierrez-ct6iw 8 ай бұрын
Nice video man, but I still feel curious about what is the main difference using this approach rather than NodeJS cluster mode, I mean what are the special scenarios where is useful to use either worker_threads, cluster mode with NodeJS or PM2 and child processes, is it also recommended to use all of them in the same app? Thank you in advance
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 8 ай бұрын
Hey mate! Thanks for watching the video and for your thoughtful question! When it comes to handling concurrency in Node.js, there are indeed several options like child processes, Node.js cluster mode, and tools like PM2. Each has its own strengths and best-fit scenarios. Child processes: These are great when you need to run separate tasks concurrently, like handling CPU-intensive operations or interacting with external processes. Imagine you're building a web server with Node.js, and you need to generate PDF reports on the fly in response to user requests. However, generating PDFs is a CPU-intensive task that could block the event loop. Here, you could offload the PDF generation to a child process, allowing your main server to continue handling incoming requests without being blocked. Node.js cluster mode: This is specifically designed for scaling your Node.js application across multiple CPU cores. It's ideal for network-bound applications where you want to take advantage of parallelism to handle multiple requests simultaneously. Suppose you're developing a chat application where multiple users can connect simultaneously. Each incoming connection triggers some processing on the server, such as authentication and message handling. By using cluster mode, you can spawn multiple instances of your application across CPU cores, allowing you to handle more concurrent connections efficiently. PM2: PM2 is more of a process manager that helps in running and managing Node.js applications in production environments. It can handle clustering, monitoring, and auto-restarting of processes, making it convenient for deployment scenarios. Let's say you have a production-grade API serving hundreds of requests per minute. You want to ensure high availability and automatic restarts in case of failures. PM2 can manage your Node.js process, keeping it running smoothly by automatically restarting it if it crashes. Additionally, PM2 can monitor CPU and memory usage, allowing you to scale your application vertically or horizontally as needed. As for whether to use all of them in the same app, it really depends on your specific use case. Generally, you wouldn't use child processes and cluster mode together since they serve similar purposes. However, PM2 can complement either of them by providing additional management features. Hope this was helpful 😊
@valikonen
@valikonen 16 күн бұрын
Don't make more sense to compare cluster with child process?
@stonebaydevil2839
@stonebaydevil2839 9 ай бұрын
Excellent video!
@rahul455roy
@rahul455roy 9 ай бұрын
Please also create video on middleware best practices
@SoftwareDeveloperDiaries
@SoftwareDeveloperDiaries 8 ай бұрын
Will do!
@vlatkod1065
@vlatkod1065 8 ай бұрын
good job man!
@elvillano1777
@elvillano1777 Ай бұрын
capo total
I tried ranking Node.js Design Patterns: Builder, Observer, Command, Prototype
10:35
Software Developer Diaries
Рет қаралды 9 М.
Mastering Memory Management in Node.js: Tips and Tricks for Better Performance
16:06
Software Developer Diaries
Рет қаралды 40 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Scaling your Node.js app using the "cluster" module
13:44
Software Developer Diaries
Рет қаралды 51 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 665 М.
Understanding Fork Bombs in 5 Minutes or Less
5:55
Engineer Man
Рет қаралды 176 М.
Node.js Event Loop Explained
10:26
Software Developer Diaries
Рет қаралды 11 М.
How to use Multithreading with "worker threads" in Node.js?
19:34
Software Developer Diaries
Рет қаралды 79 М.
A Deep Dive into Node.js Streams | Masterclass
1:15:46
Platformatic
Рет қаралды 14 М.
The React Interview Questions You need to Know
21:29
CoderOne
Рет қаралды 53 М.
Node.js Doesn’t Suck Anymore
16:59
Web Dev Simplified
Рет қаралды 133 М.
Here's why you need Nginx as a Reverse Proxy for your Node.js app
10:17
Software Developer Diaries
Рет қаралды 33 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН