Let's solve a most popular myth..!!! How does NodeJS handle multiple requests?

  Рет қаралды 5,234

Krish Dinesh

Krish Dinesh

Жыл бұрын

There's a lot of confusion out there about concurrency and parallelism. Some people use the terms interchangeably, but they actually refer to two different things.
Concurrency is when two or more tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean that they'll be running at the same time, but they can be interleaved so that at any given time, there is always one task running.
Parallelism is when two or more tasks can truly run at the same time. In order for this to happen, the tasks must be able to run on separate CPUs or cores.
So why is it important to understand the difference? Concurrency is important because it allows you to structure your code in a way that makes efficient use of resources. Parallelism is important because it can dramatically improve performance by doing more than one thing at a time.
If you're writing code that will be running on a single CPU or core, then you need to be aware of concurrency issues. If your code will be running on multiple CPUs or cores, then you need to be aware of parallelism issues.
NodeJS is a single-threaded platform. This means that it can only process one request at a time. So, how does it handle multiple requests?
This event-driven model is very efficient and allows NodeJS to handle thousands of concurrent requests with ease.
#krishdinesh #nodejs #concurrency
Support to Channel: paypal.me/HelloKrish
Facebook: / krish.dinesh.official
Instagram : / krish.dinesh.official
twitter: / krishantha (@Krishantha)

Пікірлер: 14
@shivangverma9616
@shivangverma9616 Жыл бұрын
The way you explained makes it look like a piece of cake. Great work and thank you for clearing my doubts😃👍
@dishantvashistha2038
@dishantvashistha2038 4 ай бұрын
In Place of a Database, one can assume it to be an Operating System, the v8 engine communicates with OS only to execute the program. Since OS supports multi-threading, hence things are performed faster. in the case of multiple cores, It can do I/O tasks parallelly also. But the Application thread would be only 1.
@rajanchavda1417
@rajanchavda1417 11 ай бұрын
This cleared my doubts in a very simple way. Thanks !!
@dan_le_brown
@dan_le_brown 8 ай бұрын
Great video! Enjoyed every bit and it also helped extend my understanding of the Node.JS runtime 🙌
@fullStackInKannada
@fullStackInKannada 8 ай бұрын
Thank you, really nicely explained!
@jayamaljayamaha9494
@jayamaljayamaha9494 Жыл бұрын
Nice video, understood lots of misconceptions that I had. Also, can you do a video about reactive java spring webflux. I think it will work in both a reactive way as well a parallel way. so it would be great if you can explain the mechanism of spring webflux
@techjaye1373
@techjaye1373 6 ай бұрын
This is the most interesting video about this topic I ever seen on youtube sir 🥰
@kasunperera9700
@kasunperera9700 Жыл бұрын
Thanks for clearing this myth 🤟
@DimalkaPiyumantha
@DimalkaPiyumantha Жыл бұрын
Thank you!
@rukshandevelopment2205
@rukshandevelopment2205 Жыл бұрын
When I code, I think sequentially but node works concurrently, this sometimes make things worse... can u make a video on how we should handle concurrency, or at leas how we should think on such cases.
@madushankakumara9426
@madushankakumara9426 Жыл бұрын
thank you sir. I like to know how work java application when multi treading and concurrent processing.(like spring web)
@Kumuthini2024
@Kumuthini2024 Жыл бұрын
So what’s the best backend for multi threading request you think? Let’s think we making a quiz app and there’s a lot of users sending request at the same time.
@lahiruliyanage7066
@lahiruliyanage7066 Жыл бұрын
Superb
@vergil_389
@vergil_389 Жыл бұрын
your english is confusing enought, are you saying node can do this or can't do this I can undertand that you have the concept figured out, but because of barrier I'm unable to clearly I understand what you are saying
Why HTTP based Microservices is a BAD idea. | explained with example
20:44
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 88 МЛН
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,9 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 7 МЛН
Which one of them is cooler?😎 @potapova_blog
00:45
Filaretiki
Рет қаралды 10 МЛН
I almost messed up...!!!
13:35
Krish Dinesh
Рет қаралды 851
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 263 М.
Do NOT allow your company to do this to you
8:56
Krish Dinesh
Рет қаралды 2 М.
Kafka Consumers in Python - A Walkthrough
14:28
Quix
Рет қаралды 3 М.
When is NodeJS Single-Threaded and when is it Multi-Threaded?
18:42
Hussein Nasser
Рет қаралды 70 М.
Here's Why Node JS is NOT Single Threaded
8:52
Mehul - Codedamn
Рет қаралды 14 М.
Earn or Learn if not Quit...!!!
4:59
Krish Dinesh
Рет қаралды 1,5 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 628 М.
oAuth and OpenID connect | Most confusing topic in plain english
31:11
Don't Do this Mistake in Microservice projects | Kafka or RabbitMQ
28:04
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 88 МЛН