Concurrency vs Parallelism in Node.js

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

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

  • @sanjarcode
    @sanjarcode Год назад +13

    A point that's often missed, including here, is that the event loop comes into picture only after all synchronous code has finished executing. The queues are populated from the beginning, yes, but they come into the picture only when synchronous code has finished executing.

    • @dheeraj_kr._shrivastva2.118
      @dheeraj_kr._shrivastva2.118 8 месяцев назад

      how about when we use await does it wait make that sync code or instead of switching task it stays and answer it?

    • @abdulsalamalmahdi8332
      @abdulsalamalmahdi8332 5 месяцев назад

      ​@dheeraj_kr._shrivastva2.118 could you rephrase the question better or at least use some punctuation.

  • @DavidMood
    @DavidMood 2 года назад +14

    U watched it till the end. It was actually a concept I looked to learn more. Please tell more about practical applications of parallelism with some code examples. 🙏

    • @sumitganjave3129
      @sumitganjave3129 2 года назад +2

      Yes.. give detailed explanation on node parallelism

    • @shubhamsingh4701
      @shubhamsingh4701 2 года назад +1

      your can refer to thread pool in node js I think you will get some practical example.....

    • @justinJ689
      @justinJ689 2 года назад +1

      yes, please give an example.

    • @sourav_singh_diaries
      @sourav_singh_diaries 6 месяцев назад

      Parallelism is something which I wanna add about. True parallelism can only be achievable via multiple CPUS or multiple Cores of CPU.
      If you just make 4 process of nodeJS, one single core CPU won't be able to execute it parallely. Parallelism is actually about leveraging the hardware of machine
      Not just processes but you can also have just worker threads in same process with multiple Cores for parallelism
      I have talked about here : ruclips.net/video/p-i-fo0OgXA/видео.htmlsi=HpL64INhhR1qx7Bk

  • @bleakCode
    @bleakCode 2 года назад +5

    I really loved how you explained how concurrency works in nodejs without throwing too many jargon. It was also interesting to note that tho nodejs code might not be running parallel. But system calls are running in parallel to get things done faster

  • @aurobindobhuyan2107
    @aurobindobhuyan2107 6 месяцев назад

    I was learning Node clustering, and this video added more details to it.❤

  • @shubhamjaiswal9100
    @shubhamjaiswal9100 2 года назад +3

    Ajinkya Rahane Cricketing career ka pata nhi ....but his teaching career in coding seems to be bright enough

  • @Systemv1
    @Systemv1 Год назад +1

    Fantastic - thank you for the talk. The whiteboard approach works really well :)

  • @qcmira2024
    @qcmira2024 2 года назад +3

    I watched the video til the end and as usual I learned a lot ! Thanks ! Any chance you can explain in a future video how BullMQ works ?

  • @adityarawat4964
    @adityarawat4964 6 месяцев назад

    This guy is a true fullstack developer

  • @prashantbismani
    @prashantbismani 10 месяцев назад

    Amazing Explanation, Thank you for making this. Please continue creating such videos, you got huge potential.

  • @Sandeep-zd6dq
    @Sandeep-zd6dq 2 года назад +1

    Simple easy explanation of event loop. 🙌👍
    Watched till the end.

  • @uzair004
    @uzair004 2 года назад +1

    multiple instance of nodejs for parallelism , is it the reason we use process manager like PM2 on production?

  • @pavan-iu7qy
    @pavan-iu7qy 2 года назад

    I watched this till the end and also watch your upcoming videos till the end

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

    nice video, learnt something new

  • @CadisDiEtrama000
    @CadisDiEtrama000 Год назад

    It would be really cool to see some kind of load testing comparison... E.g. how many users/requests or w/e can a node express server that runs inside a 2GB/1CPU VPS, etc. and how each of such different approaches affects that

  • @dwaipayansen2966
    @dwaipayansen2966 2 года назад

    I watched this video till the end and it was very lucid, thanks!

  • @ankitaggarwal9438
    @ankitaggarwal9438 2 года назад

    I WATCHED THIS VIDEO TILL THE END!

  • @jimlougheed9922
    @jimlougheed9922 2 года назад

    I watched this video to the end, great info!

  • @ubaidkhan426
    @ubaidkhan426 2 года назад

    Splendid explanation 👍 I've watched the video till the end. Thank U :)

  • @abdulazeezshakrullah9630
    @abdulazeezshakrullah9630 2 года назад +1

    Which is faster and easier to maintain , an app built from only Node.js or stack combination. I always think it's hard to learn node.js, since I haven't started learning. I'd like to learn through your recommended videos or sites. THANKS.

    • @kofiboateng9181
      @kofiboateng9181 2 года назад +1

      JavaScript is inherently slower than almost server side code (Go Rust Java etc..) if you are writing a enterprise level app, you will most likely use multiple backends depending on your business needs (Java, Typescript/Node, maybe Django) most Fortune 500 countries are using multiple backends and then Angular/ReactJs+Typescript for static and pseudo static typing

    • @sanjarcode
      @sanjarcode Год назад

      Node.js is the easiest to learn in general, and including if you need parallelism. It's slower than Golang and Rust, but they're harder to learn as compared to JS.

  • @jorgeortiz41395
    @jorgeortiz41395 2 года назад

    Got to respect the work and consistent video upload schedule!

  • @MuhammadUsman-gz8fk
    @MuhammadUsman-gz8fk Год назад

    Nice Presentation

  • @sanjarcode
    @sanjarcode Год назад +1

    Folks, true parallelism is possible in Node.js (using the worker_threads, or cluster module or pm2 - pick what is suitable for you). For speed, use a different language.

  • @eric000
    @eric000 2 года назад +3

    Pls clarify for parallelism no change in code is needed? NodeJS does it by itself of multiple cores available?

    • @dhanushs9159
      @dhanushs9159 2 года назад +1

      You need to make use of cluster module (inbuilt to node). Or you can make use PM2.

    • @eric000
      @eric000 2 года назад

      @@dhanushs9159 thanks👊👍

    • @sanjarcode
      @sanjarcode Год назад +1

      We already have the answer, but just answering them in order.
      1. Almost no change needed. Some change if using cluster module. No change needed if using pm2.
      2. Node.js does it by itself. Parallelism will happen if cores are available, otherwise the tasks will compete.

  • @z.cibis-iqbal8774
    @z.cibis-iqbal8774 2 года назад

    Thanks allot, i watched the video till the end:)

  • @tahasaleh4697
    @tahasaleh4697 2 года назад

    Watched till the end 👍

  • @geekofia
    @geekofia 2 года назад

    I watched this video till the end as always ❤️

  • @ruhankhandakar
    @ruhankhandakar 2 года назад

    always watched all videos of ur till the end

  • @ashish_prajapati_tr
    @ashish_prajapati_tr 2 года назад +1

    awesome

  • @ikumargaurav
    @ikumargaurav 2 года назад

    I watched the video til the end.

  • @Rajkishan1000
    @Rajkishan1000 2 года назад

    I watched this video till the end

  • @douglasmiranda4756
    @douglasmiranda4756 2 года назад

    Thank you very much!

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

    I watched to the end. Give me something!

  • @tibzdankan
    @tibzdankan 2 года назад

    I watched the video till the end

  • @SleepeJobs
    @SleepeJobs 2 года назад

    Excellent explaination

  • @vasurangpariya8492
    @vasurangpariya8492 2 года назад

    Great please give more videos about node js

  • @djharshal0007
    @djharshal0007 Год назад

    Amazing explanation 👌🏻👌🏻

  • @ahsanhabibabir5887
    @ahsanhabibabir5887 2 года назад

    thnx, this was very useful

  • @ADITYAKUMARking
    @ADITYAKUMARking 2 года назад

    I watched this video till the end.

  • @rahuleum
    @rahuleum 2 года назад

    I watched till the end

  • @liu-river
    @liu-river 11 месяцев назад

    How do you run nodejs in all 4 cores? Do you mean using worker threads?

  • @isurucumaranathunga
    @isurucumaranathunga 2 года назад

    Thank you so much

  • @rushikeshkhilari4662
    @rushikeshkhilari4662 2 года назад

    then what promise.all() can be defined?

  • @dizzymolecule6759
    @dizzymolecule6759 2 года назад

    This is similar to the scheduling concept in operating system. For example round robin scheduling

  • @thesouth4976
    @thesouth4976 2 года назад

    " You from another universe"😂😂 nice reference

  • @HarshSingh-cp8mq
    @HarshSingh-cp8mq 2 года назад

    sir , so should i move to Golang to achieve parallelism

  • @sourav_singh_diaries
    @sourav_singh_diaries 6 месяцев назад

    Good explaination.
    Parallelism is something which I wanna add about. True parallelism can only be achievable via multiple CPUS or multiple Cores of CPU.
    If you just make 4 process of nodeJS, one single core CPU won't be able to execute it parallely. Parallelism is actually about leveraging the hardware of machine
    Not just processes but you can also have just worker threads with multiple Cores for parallelism.I have talked about here : ruclips.net/video/p-i-fo0OgXA/видео.htmlsi=HpL64INhhR1qx7Bk

  • @poonamgur2294
    @poonamgur2294 2 года назад

    So how multithreading is different?

  • @ankitbinjola
    @ankitbinjola 2 года назад

    Is node microservices an example of parallelism ?

  • @dhanabalt5552
    @dhanabalt5552 2 года назад

    Perfect 👍

  • @souravdas423
    @souravdas423 2 года назад

    I have a small doubt suppose my one code a different process and on a different thread. Are both of them an example of paralism?

    • @sanjarcode
      @sanjarcode Год назад +1

      1. Different processes - will run parallelly if CPU cores are available, otherwise they'll complete (i.e. it'll become concurrent). How to implement - cluster module or the pm2 package.
      2. Different threads on same Node process - same as before. How to implement - worker_threads.
      Parallelism depends on CPU number cores.

  • @hamzarasool7669
    @hamzarasool7669 2 года назад

    where do we use this concept in real life

  • @anthonypace5354
    @anthonypace5354 9 месяцев назад

    workers?

  • @vishal_sharma_rha
    @vishal_sharma_rha 2 года назад

    Great 👍

  • @ahmedhafez9951
    @ahmedhafez9951 Год назад

  • @epinino
    @epinino 2 года назад

    how to do it in nodejs?

  • @maacpiash
    @maacpiash 2 года назад +2

    Still don't like this whiteboard format, man.

  • @AllanSavolainen
    @AllanSavolainen 2 года назад

    I hope they fix this limation soon, there are so many easy things you could parallelise in JS. All event listeners should run in their own threads, as all settimeouts etc. All async calls can be run in their own threads. Just add automatic locking on global variables and DOM and it should just work.

  • @chrissigrilus6390
    @chrissigrilus6390 2 года назад

    Your videos become better and better from a quality perspective but become worse and worse from the point of video quality :D You should review your video setup and fix the issue, it has been much better in the past.
    I would also wish that your website would provide more courses than are longer and go into more detail. Currently it makes no sense to subscribe because I would finish all courses in a matter of weeks and they are to short to really go into detail.

  • @kailash4591
    @kailash4591 2 года назад

    The end of video.

  • @deepak.chandola
    @deepak.chandola 2 года назад

    I see your videos regularly but this one seemed completely irrelevant for a ~8 min video.

  • @parvati27
    @parvati27 2 года назад

    If only your english is good, you would be a great asset

  • @Aditya.Santra
    @Aditya.Santra 2 года назад

    I WATCHED THIS VIDEO TILL THE END!

  • @vishveshguthal
    @vishveshguthal 2 года назад

    I watched this video till the end

  • @ankitsuda
    @ankitsuda 2 года назад

    I watched the video till the end

  • @GarTheStar
    @GarTheStar 2 года назад

    I watched this video till the end

  • @mohamedfaalil
    @mohamedfaalil 2 года назад

    I watched this video till end