How NodeJS Works? - You don't Know NodeJS

Поделиться
HTML-код
  • Опубликовано: 28 май 2024
  • Hey Everyone, In this video, we will understand How NodeJS internally works? We'll deep dive into the concepts of Event Loop, Worker Threads, and Single Threaded Architecture of NodeJS.
    Quick Links
    Full Stack Twitter Clone learn.piyushgarg.dev/learn/tw...
    Docker Course learn.piyushgarg.dev/learn/do...
    Master NextJS 14 learn.piyushgarg.dev/learn/ne...
    NodeJS Event Loop nodejs.org/en/guides/event-lo...
    Timestamps
    00:00 Introduction
    01:25 NodeJS Architecture
    04:00 How NodeJS Code Executes?
    08:05 Thread Pool
    11:05 Event Loop in NodeJS
    15:00 Understand Event Loop with Code
    29:55 Worker Threads in NodeJS
    34:33 Increasing Worker Threads
    37:08 NodeJS vs Other Programming Languages
    41:15 Promise Handling in NodeJS
    42:32 Outro
    Video Titles
    - How NodeJS work?
    - Internal Architecture of NodeJS
    - what is Event Loop?
    - How NodeJS Handles Requests
    - NodeJS Single Threaded Architecture
    - Multi-threading with NodeJS
    Hashtags
    #nodejs #javascript #backendwebdevelopment #fullstackwebdevelopment #webdevelopment #engineering #webdevelopment #opensource #reactjs

Комментарии • 187

  • @shababsha5633
    @shababsha5633 3 месяца назад +39

    The worker pool size in Node.js was changed from 128 to 1024 in version 10.5.0. Prior to this version, the default worker pool size was 128. From version 10.5.0 onwards, you can increase the worker pool size up to 1024 by setting the UV_THREADPOOL_SIZE environment variable

    • @unemployed-coder
      @unemployed-coder 3 месяца назад +1

      what is the significance of increasing it to 1024? It would not help you execute things faster. The ideal value for the thread pool size should be equal to your number of physical cores or if your system system provides hyperthreading then a little more than that too works. @piyushgargdev am I right?

    • @manishbhardwaj4587
      @manishbhardwaj4587 3 месяца назад +3

      @@unemployed-coder agree, virtually it do make sense but physical core is what matter the most.

    • @xiaoshen194
      @xiaoshen194 3 месяца назад +2

      Shabash but video mein to 4 threads hi dikhaya h default

    • @xiaoshen194
      @xiaoshen194 3 месяца назад +2

      ​@@manishbhardwaj4587video mein 4 kyu dikhaya h default agr default 128 h?

    • @prakharsinha6915
      @prakharsinha6915 3 месяца назад +1

      ​@@xiaoshen194 Default 4 hi hai bhai... Maximum pehle 128 tha and then increased to 1024

  • @engineerslab1664
    @engineerslab1664 3 месяца назад +5

    Ye koi nhi samjhaya h avi tk , i have searched a lot , thanks buddy for this wonderful explanation 😅

  • @Khedhar108
    @Khedhar108 3 месяца назад +3

    "08:05"- Thread Pool
    "12:27"- IO polling
    "21:30" - undefinite behaviour of setTimeout and setInterval in main thread

  • @raunakhajela
    @raunakhajela 3 месяца назад +4

    This is the best explanation by far. You explained it so well. I would like to learn more nodejs concepts that no one is talking here.

  • @prvnpn216
    @prvnpn216 2 месяца назад +1

    this is like the most in-depth video on Eventloop and working of Node.js I found, Need a course like this.

  • @vamsimudaliar7931
    @vamsimudaliar7931 3 месяца назад +1

    One of the finest and in-depth explaination. Thanks Piyush❣

  • @sundaramjha1776
    @sundaramjha1776 3 месяца назад +3

    Very well explained really. Have seen lot of other event loop video but this is special. Please continue creating this types of videos.

  • @tanishqmanuja
    @tanishqmanuja 3 месяца назад +2

    Best node architecture video i have seen so far, keep up the good work 💯

  • @ajmaln73
    @ajmaln73 2 месяца назад +1

    Thank you, I was looking for Nodejs Internal Working explanation for the last one year, This one is more Helpful kudos

  • @Akhil_NK
    @Akhil_NK 2 месяца назад +1

    Best Explination and the simplest one so Far Thanks Bhaiya

  • @kiranmohare6276
    @kiranmohare6276 3 месяца назад +1

    Awesome explanation of Node JS Architecture, especially Event Loop which had very confusing for me before watching this detail video.
    Thank you so much for such awesome video

  • @NilanjanH
    @NilanjanH 3 месяца назад

    I really liked the way you explained, thanks for the easy explanation. I have never been understood better before watching this video. 👏

  • @hasnainmalik9644
    @hasnainmalik9644 3 месяца назад

    Awesome explanation of Node JS Architecture, especially EventLoop which had very confusing for me before watching this detail video.
    Thank you so much for such awesome video.❤❤

  • @anujeetswain7368
    @anujeetswain7368 3 месяца назад

    Awesome video man!. I was very confused about differentiating the timers and io execution timings.

  • @krishna04051984
    @krishna04051984 4 дня назад

    Thanks piyush🎉. Best video for this topic, no one explained like this in RUclips and I saw many video to clear this concept. Watch ing this video I got the concept, need to watch more this video to clear more

  • @VishalYadav-gk1kg
    @VishalYadav-gk1kg 20 дней назад +1

    Very nice explanation sir, Thank you!

  • @mayanksh219
    @mayanksh219 2 месяца назад

    Thank you Piyush for this amazing video. I learned a lot from this video like EventLoop and under the hood working of Node.js.

  • @mohdaqib3638
    @mohdaqib3638 3 месяца назад

    Thank you for creating such an insightful and engaging video, I truly appreciated the valuable content and your skillful presentation. want more related videos, Thankyou!!

  • @suryagupta1999
    @suryagupta1999 3 месяца назад +1

    Nice explanation 😃....Easy explanation for beginners.

  • @AsifAli-cp7uj
    @AsifAli-cp7uj 2 месяца назад

    Content is pure gold straight from heaven mann I am craving for more wisdom from this guy thanks piyush bhaiya

  • @Baljeetkaur-tu8qx
    @Baljeetkaur-tu8qx Месяц назад

    Such a detail video . Quite interesting and helps understanding deep concept of Node.js

  • @silentsagateller
    @silentsagateller 3 месяца назад

    This video was very helpful, thank you for the wonderful explanation of node.js architecture 😊

  • @user-ec4sx6gg5w
    @user-ec4sx6gg5w 3 месяца назад

    i see the full video as well as coded with you . and thnx for this beautiful video . good work

  • @lucky-laxmi4799
    @lucky-laxmi4799 2 месяца назад +1

    Awesome explanation. Keep making more of these in depth videos. 😍

  • @shaileshkamble8730
    @shaileshkamble8730 3 месяца назад

    Very indepth concept clearing video..... Thanks Sir...💌

  • @me-16ayushverma40
    @me-16ayushverma40 3 месяца назад +1

    outstanding way of explanation bhaiya

  • @hatimtekri4949
    @hatimtekri4949 3 месяца назад

    Excellent explanation man
    Hats off
    Please create such videos, in nodejs only
    More insight about node js

  • @roshanaswal7221
    @roshanaswal7221 3 месяца назад

    Amazing sir, i would like to see more of these kind videos from you. Thank you for your content

  • @algobuddy
    @algobuddy 3 месяца назад +2

    Nice one bro, good to see you grow❤

  • @anikettripathi1160
    @anikettripathi1160 2 месяца назад

    Gem 💎content, bhaiya. Keep it up 👍Thank you!

  • @thisravigangwar
    @thisravigangwar 3 месяца назад

    Yes, aur videos chahiye, and what session bhaiya, bhaiya poora din barbaad krdiya faltu me ab neend achhi aayegi yh video dekhne ke baad.❤❤

  • @Kiran-khadka
    @Kiran-khadka 3 месяца назад +1

    Informative as usual❤

  • @krishna04051984
    @krishna04051984 4 дня назад

    Plz make more video like this .
    Thanks from my bottom of heart❤

  • @bulbergaming9142
    @bulbergaming9142 3 часа назад

    i think threadpool doesn't handle cpu intensive tasks,it only handles some cpu intensive tasks.for example:while loop with very long iteration is considered as cpu intensive task but it is not handled by the thread pool.

  • @niraz9701
    @niraz9701 3 месяца назад

    How can I thank you for being upload such a great video 😍

  • @PramodSharma-dq3pi
    @PramodSharma-dq3pi Месяц назад +1

    @piyushgargdev : How will the thread pool handle dynamic cryptographic requests? For example, if 1000 users requests password encryption at same time, how can the Node server manage these requests, given that we can't predict their origin?

  • @rohitpatel2671
    @rohitpatel2671 3 месяца назад +3

    i need this types of videos. please sir... to be continue............

  • @najimali32
    @najimali32 Месяц назад

    Great Video. Enjoyed it a lot.

  • @akshaykatrodiya6149
    @akshaykatrodiya6149 3 месяца назад

    "great explanation of how the Node.js event loop works", WD 👌🏽

  • @RahulChaudhary-hi2zo
    @RahulChaudhary-hi2zo Месяц назад

    Very Nice Video man, keep doing like this .

  • @azimkhan3927
    @azimkhan3927 2 месяца назад

    great video, nicely explained

  • @dhrubohootowl7579
    @dhrubohootowl7579 3 месяца назад

    very well explained thank you

  • @user-fo7qz5vo3v
    @user-fo7qz5vo3v 3 месяца назад +1

    ❤ Thankyou for explaning

  • @SandeepSingh-px3sw
    @SandeepSingh-px3sw 3 месяца назад

    Ultimate😮 video, we want more videos like this.....

  • @meghnasrivastava568
    @meghnasrivastava568 Месяц назад

    Hands down the best video!

  • @waleed28ful1
    @waleed28ful1 2 месяца назад

    Amazing
    Thankyou soo much for amazing content

  • @643kanavguleria9
    @643kanavguleria9 3 месяца назад

    amazing explanation , learned alot 👍

  • @Ayush37262
    @Ayush37262 3 месяца назад +12

    Sir your NodeJS playlist >>> All paid + free courses 🗿

    • @shadabb2001
      @shadabb2001 3 месяца назад

      which theme is he using do you know ?

  • @pranayraj8945
    @pranayraj8945 3 месяца назад

    What an OP explanation!! ❤❤❤

  • @shaikhali5364
    @shaikhali5364 3 месяца назад +1

    Nice explanation! ❤

  • @praveshpal9644
    @praveshpal9644 3 месяца назад

    perfect explanation sir 💯💯

  • @unemployed-coder
    @unemployed-coder 3 месяца назад +1

    Nicely explained ❤❤

  • @rudrikasingh2892
    @rudrikasingh2892 2 месяца назад

    Best explaination ever!

  • @rohansinghrathore5012
    @rohansinghrathore5012 3 месяца назад +1

    Hello Piyush Sir , I am being following your nodejs series , and currently i am on authentication. Sir my question is .. what is the best way to revise the concepts in nodejs or any other backend technologies .. so that my i can master the concepts properly ...
    BTW your nodejs series is awesome💫

  • @abirsinha923
    @abirsinha923 8 дней назад

    excellent explanation 👌 👏 👍

  • @punitpubggaming7531
    @punitpubggaming7531 3 месяца назад

    Much needed video, but just a suggestion, Please keep theme costant to dark everywhere, it will look more aesthetic and there will not a flashes in our eyes. Thanks 😂😂

  • @veerendrashukla
    @veerendrashukla 3 месяца назад

    very nice. nice drawing, nice explanation.

  • @adityacholkar1421
    @adityacholkar1421 3 месяца назад

    Very well explained👍

  • @dhruvdeora9781
    @dhruvdeora9781 3 месяца назад

    very imformatiive video. loved it

  • @AvinashSingh-tr5vt
    @AvinashSingh-tr5vt 3 месяца назад

    Awesome explanation 💚💚

  • @coderkashif
    @coderkashif 3 месяца назад

    This is amazing....Thank you....

  • @devangsharma8937
    @devangsharma8937 2 месяца назад

    Thanks a lot for the video

  • @abhisheknavgan6829
    @abhisheknavgan6829 3 месяца назад +2

    nice video

  • @Zaheer__zk40
    @Zaheer__zk40 Месяц назад

    Nice explanation ❤❤

  • @sameergaikwad222
    @sameergaikwad222 3 месяца назад

    Nice And Detailed Explanation. Quite Impressed.😍 Can you please also share those Notes.👍👍👍 Thanks👍👍👍

  • @chidambarjoshi3470
    @chidambarjoshi3470 3 месяца назад

    Next level explaination

  • @mohitjindal2036
    @mohitjindal2036 3 месяца назад +1

    Please make on video on how await works in this internally

  • @supravatsarkar5866
    @supravatsarkar5866 22 дня назад

    Never seen like that explanation .... Thank you so much Piyush Vai 💌. Create courses (Paid) regarding System Design /DSA / Devops/Microservice . All the best.

  • @TanmaySarkar
    @TanmaySarkar 3 месяца назад

    Very informative 💪🏻

  • @sumirandahal76
    @sumirandahal76 3 месяца назад

    THank you so much I enjooyed and understand

  • @harshmehrotra1214
    @harshmehrotra1214 3 месяца назад

    reallly like to watch the explation of js working please make a video on that

  • @rishabhkedia9304
    @rishabhkedia9304 3 месяца назад

    put more videos like this. it'll help you build core audience.

  • @greeneryman2699
    @greeneryman2699 3 месяца назад +3

    42:45
    Yes cha hi hai aise video

  • @JitendraLodhi-ei6vs
    @JitendraLodhi-ei6vs 3 месяца назад

    Very knowledgeable video🎉🎉🎉

  • @houseofcoding101
    @houseofcoding101 3 месяца назад

    Thank you sir!

  • @prakharsinha4145
    @prakharsinha4145 3 месяца назад

    hey piyush one doubt as you said ki, for cpu intensive tasks we should go for multithreaded languages, but that too can be done using NODEjs right?

  • @GunjanShrimali
    @GunjanShrimali 3 месяца назад

    Great video best ever explain

  • @shivashukla7894
    @shivashukla7894 3 месяца назад

    @0.3s why I am getting the output same in both the cases? console of the setTimeout functin is getting printed first and later console of setImmidiate is printed, and this is same for both the cases.

  • @JS84129
    @JS84129 3 месяца назад

    Need more video like such

  • @r_lyricals_6201
    @r_lyricals_6201 3 месяца назад

    Genius brother 🎉

  • @bincebee
    @bincebee 3 месяца назад

    Hello Piyushbro,
    Please make video on transaction in mongoose…
    Your teaching method is very helpful..

  • @ayandippaul3108
    @ayandippaul3108 Месяц назад

    Bro really greattt❤❤

  • @sidhant251
    @sidhant251 2 месяца назад

    Great video 😇

  • @vrutilkjadav1030
    @vrutilkjadav1030 Месяц назад

    informative video!

  • @mukulyadav3770
    @mukulyadav3770 3 месяца назад

    Absolute stunner

  • @pravinrathod1676
    @pravinrathod1676 3 месяца назад

    Hi Piyush,
    Nice video with explain.
    I have one question kindly if possible please make video on it.
    Consider one use case where I have Nodejs application with /abc endpoint inside this endpoint I have one function which is 1M of for loop which take time to complete 3 sec then give response to the endpoint. So 5 users can parallel make requests to this endpoint so what is time for 5th user will take ?
    Is it 3 sec or 15secs and why ??
    THANKS

  • @shahzadmujtaba1725
    @shahzadmujtaba1725 3 месяца назад

    I love it make more videos on docker

  • @RohitRaj-od3be
    @RohitRaj-od3be 3 месяца назад

    very interesting video.

  • @smartguy3k
    @smartguy3k Месяц назад

    great! Thanks

  • @replymeasapp
    @replymeasapp 3 месяца назад +1

    sir please one video on all the vs code extensions you use please

  • @crsanjaysingh1737
    @crsanjaysingh1737 3 месяца назад

    PHP is not multithreaded. PHP-FPM can handle multiple incoming requests at once by launching multiple processes. I like your node js explaination

  • @user-dd6zl4kg9d
    @user-dd6zl4kg9d 3 месяца назад

    bro some are some thing diff bro great work

  • @gujaratinimoj3845
    @gujaratinimoj3845 3 месяца назад

    Good sir..👍👍

  • @_Blackwolf_01
    @_Blackwolf_01 3 месяца назад

    Thanks bhai ❤

  • @atanumojumdar
    @atanumojumdar 3 месяца назад

    Thankyou 💜

  • @krishpatel3199
    @krishpatel3199 3 месяца назад

    Can it do multi threading like java?

  • @mayankjain7910
    @mayankjain7910 Месяц назад +2

    you are wrong u said that first top level code run then require module run that is wrong u can take example that create fs.readFileSync and console.log its output and then run console.log("0") then output will be return result of fs.readFileSync then 0 will be printed

  • @vinitjain7
    @vinitjain7 3 месяца назад

    Thank u sir

  • @shubhamgupta-bl1tr
    @shubhamgupta-bl1tr 3 месяца назад

    Just you use crypto.. to node js automatic decide kr leta h kya isko thread pool me excute krna h ?

  • @codewithsyedmqasim
    @codewithsyedmqasim 3 месяца назад

    helpful video