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

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ส.ค. 2024
  • 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

ความคิดเห็น • 20

  • @mooza.shorts
    @mooza.shorts ปีที่แล้ว +21

    Finally some advanced node content

  • @nhatnguyenhuu7822
    @nhatnguyenhuu7822 11 หลายเดือนก่อน +2

    It's very useful for us! Thanks a lot and keep up your work!

  • @Dinomight-zz6bp
    @Dinomight-zz6bp 27 วันที่ผ่านมา

    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.

  • @RajSekharK
    @RajSekharK 5 หลายเดือนก่อน

    Waw. The section "when to use X" clearly explains how to do decision making. ❤ I subscribed to your channel, after this short.

  • @nagarjundeepak
    @nagarjundeepak ปีที่แล้ว +2

    great explanation. thanks

  • @muhammedhuzaifa1392
    @muhammedhuzaifa1392 หลายเดือนก่อน

    can I use both first if I swpan thread then cluster my node js

  • @adhishankarit
    @adhishankarit 9 หลายเดือนก่อน

    Is there any data processing framework return using Node JS similar like Apache Spark

  • @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  ปีที่แล้ว +2

      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 8 หลายเดือนก่อน +1

      pm2 actually uses the node.js cluster module under the hood.

  • @Superuser-r1y
    @Superuser-r1y ปีที่แล้ว +1

    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  ปีที่แล้ว +1

      You definitely can 😉

    • @Superuser-r1y
      @Superuser-r1y ปีที่แล้ว +1

      ​@@SoftwareDeveloperDiaries ok sir thanks, ❤❤ from India 🇮🇳🇮🇳

  • @maedez4189
    @maedez4189 9 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

    Go programmers: "look what they need to mimic a fraction of our power"

    • @themaridv2000
      @themaridv2000 2 หลายเดือนก่อน

      FOR REAL. But node has more work demand 😢

  • @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 ?