Having an explanation of the technology before diving into the code is extremely useful. A lot of youtube channels don't explain anything.
@raymrash4 жыл бұрын
absolutely
@SirajAhmed-zn8eh4 жыл бұрын
Get "Learn and understand NodeJS" by Anthony Alicea on Udemy. It's a gem. Takes apart NodeJS and explains its basic behaviors.
@YouilAushana Жыл бұрын
Others can be, Unapologetically greedy.
@brunobernard864 жыл бұрын
Hey, you need to do a series on "When and when not to use". Very interesting :)
@hichamo-sfh1774 жыл бұрын
Yes that's a good suggest
@ayanSaha132914 жыл бұрын
Dear Koushik, You are outstanding as always. I could not find a single person who speaks technology as simply as you do. I have been following you for more than 7 years now. I truly appreciate your efforts. Thank you.
@carlosbarbier24014 жыл бұрын
I have been working with node js for a while but this tutorial is one of the best tutorials out there. Thanks for sharing your knowledge
@liamsmith-yp3xh4 жыл бұрын
when to use: "do this then this, then this, then this" when not to use: "generate every prime number up to 100000000000000000000000000000000000000000000000"
@hattrickster334 жыл бұрын
At that point, you would be using C lol
@raushonmunni26333 жыл бұрын
I tried to do that once.
@mykola56694 жыл бұрын
That's the best "how, why and when" video about programming languages I saw by this day. Well done!
@MrSidMan4 жыл бұрын
When NOT to use Node.JS: When your client insists you use PHP.
@ask4funs_solution4 жыл бұрын
hahahaha
@tdias254 жыл бұрын
i bet you "work" with wordpress
@dayvie95174 жыл бұрын
When your client insists that you should "destroy an already existing wordpress solution"
@leimococ4 жыл бұрын
so true
@nexovec4 жыл бұрын
LOL
@SachinKumarSahu2 жыл бұрын
Having experience of working in Node for last couple of years, but some info in this tutorials are complete GOLD
@ibrahim474 жыл бұрын
Great video, one thing to add is it's commonly used in distributed systems. thanks to its non-blocking ability and asynchronous behavior. this is why is it called node after all. because a nodeJs server is just a node among other nodes.
@karthik-ex4dm4 жыл бұрын
One of best explanations of event driven model of Node.js Eagerly waiting for the next video
@sumathisreebaskarrao15473 жыл бұрын
You are a life saviour Mr.Koushik !
@simomed50024 жыл бұрын
wow being more than 10 years in web development... I like how simply you explain the details! keep moving bro, I'm definitely following your tutorials and moving to node js from the programming language I'm using right now, also I subscribed to your channel :)
@estessaouira19004 жыл бұрын
compute intensive is no more problem for nodeJs due to Worker Threads on node 10.5.0 .
@manikanth21664 жыл бұрын
Still it carries the javascript overhead which is quite negated with io bound concurrency. And 70% of the real world business require that io bound concurrency.
@johndoe-gt4rx3 жыл бұрын
@@manikanth2166 yeah it really depends on the size of the project/business as well. Node is so quick and painless to develop for that it's worth using for almost any app that will have a small userbase. I've even just gone and created microservices with GO that sit on the same box and communicate with the main node web server through a REST api.
@tsunekakou12754 жыл бұрын
you got one mistake there, asynchronous doesn't have anything to do with multi-threading. it is possible to do asynchronous calls in a thread pool. you can have threads execute mutiple event loops, process non-blocking i/o calls, and no thread have to wait for IO (unless you call synchronous/blocking operation). asynchronous i/o operations are offered by the operation system, there is no rule dictate you need to use single thread model or muti-thread model to use these async API.
@piotrgoabek61664 жыл бұрын
But, I guess, it's often put like this - if you have a multhithreaded framework, go ahead and use the luxury of a blocking model. The resulting code is more clean and decoupled.
@tsunekakou12754 жыл бұрын
@@piotrgoabek6166 .net support non-blocking i/o api out of the box with async/await (sort of like coroutine). the benefits of coroutine is that you have a nice synchronous-like control flow, look really clean, easy to reason about even in multithreaded environment. other example is boost::asio in C++ support coroutine, callbacks, proactor model, blocking and non-blocking operations and possible to decouple with template. it's often like this, if you have a multhithreaded framework, go ahead and use the luxury support of non-blocking api, the resulting code might be efficient, might be clean if you know what are you doing. the point here is multithreading with asynchronous is possible, there are framework support these thing. to be honest, i think people that write multithreaded program will use non-blocking i/o if they can, their concern is performance. you can write clean, decoupled asynchronous code in multithreaded, because again these things aren't really relate.
@gravy17704 жыл бұрын
He did not conflate the two though. He used examples of typical situations where synchronous calls are used with multi threading and asynchronous calls are used with single threading. His diagram of a thread pool even shows an asynchronous call being made
@omg_look_behind_you4 жыл бұрын
when exactly did he claim this?
@tsunekakou12754 жыл бұрын
@@omg_look_behind_you 6:50 , 7:17 "it has to wait". he did mention at 7:26 "thread pool with `synchronous` execution has that kind of behavior". he tried too hard on selling nodejs's singlethread model by compare it with a very inefficient multithread model and failed mention about multithread with asynchronous. yes, he didn't claim mutlthread models can't do asynchronous. I won't discuss this anymore, he didn't even bother to comment, so it's a negetive-sum game.
@asifmahmood93584 жыл бұрын
This channel should be renamed as tea with java brain... Ur doing awesome work love from Pakistan
@alexandertarasenko30384 жыл бұрын
It is pleasant to find Java devleoper who doesn't just blame javascript) Thank you for this movie!
@sytranvn4 жыл бұрын
In fact node can use multiple cores if needed. But it is hidden from the developer's view and taken care of by libuv.
@seanb99495 ай бұрын
Very clear explanation sir. I loved every minute of this video and walked away feeling like an expert.
@XiaZ4 жыл бұрын
In a multithreaded environment: Many waiters take orders from the customer and wait at the kitchen for the food to be prepare before delivering it to the table, order by order. In Node.js environment: One single waiter takes the order and then tell the cook what to prepare, and only when the food is done, come back and take it to the table. PS. Node.js can also have more than one waiter, the waiter is just smarter by not waiting at the kitchen ;)
@hariwarshan9314 жыл бұрын
Ok then what is the one who is actually preparing the food. for example am asking 5 different data which is in mongodb through 5 requests and so who is actually getting the data from mongodb ( who prepares food ). Is that a separate process ?
@XiaZ4 жыл бұрын
@@hariwarshan931 It depends on number of workers handing the stove you have. In case of MongoDB, this number will be equal to core count on your DB server. waiter can submit the order to kitchen and then go back to his work, and depend on number of cook you have, they'll start preparing the food by order, when done, waiter go back to get the food to the table.
@shaileshsingh56644 жыл бұрын
NICE lets make this lockdown a little educational and knowledgeable
@codeblueocean35203 жыл бұрын
I learnt mern from online courses but understood the core architecture/logic from this video.thankyou very much
@aakashggujju4 жыл бұрын
Man you are the best and let me tell you that listening to you is always blissful and let me tell you that you are an awesome teacher and always make things simple and cool for listener's. Thanks. 🙏
@sneak94072 жыл бұрын
You deserve more likes and views for the great analysis on node in this video.
@MultiMtech2 жыл бұрын
I was also Java Programmer and loved to write java programs... But since I started learning NodeJS, I really get in love with Node.Js specially with Nest.JS Framework...
@devdylan61524 жыл бұрын
you covered this SO WELL... like you hit all the proper keys and put it all in a easy to digest manner, I will be using this to explain this to people D:
@mechenzyhammah30014 жыл бұрын
You are the best teacher online. Like 👍
@gokulraja20064 жыл бұрын
This is the best tutorial I have ever seen.
@philheathslegalteam4 жыл бұрын
This has to be the best explanation of NodeJS yet.
@flyingleaves54803 жыл бұрын
Most informative I've seen so far... Thank you
@MrJonathandsouza2 жыл бұрын
You can always use process manager like pm2 to spawn multiple instances of your node app and then act like a load balancer.
@Dev-Siri Жыл бұрын
this is a good enough approach, although processes are heavier than real multi-threading. Worker threads solve this well but they have a funny api.
@subhadas75024 жыл бұрын
5:37 'javascript is asynchronous' is quite misleading, But well-covered use cases of node js.
@hailahong30214 жыл бұрын
Abdelmalek BELAÏD Js is synchronous all the way. It’s the chrome engine that handles the asynchronous parts.
@behzadghorbanny76574 жыл бұрын
@@hailahong3021 well we're talking about node.js as a whole here.
@hailahong30214 жыл бұрын
Behzad Ghorbanny and nodejs use chrome engine to handle the async parts. What are you trying to say? It’s a framework, it doesn’t change how the language works.
@behzadghorbanny76574 жыл бұрын
@@hailahong3021 err.. I thought you were saying node.js is synchronous because js is synchronous. My bad.
@techyintelo95564 жыл бұрын
@@hailahong3021 Node js isn't a framework
@aki1840 Жыл бұрын
Great explanation! Unbiased opinion on Node. I’m tired of all these haters 😂
@ragingpahadi4 жыл бұрын
i like this series when and when not ! :D "Just because you can do it doesn't mean you should do it"
@jenishvadodaria28883 жыл бұрын
You are a gem for Providing us with this example. Thank you!!
@ernestmolner183 жыл бұрын
You can make node multi thread if you want to. It is not usually that way but there are modules that make it as multi thread as you want it to be.
@jeronimoolivavelez12994 жыл бұрын
Great Explanation. It is important, not only to know the code language but also learn which code is better to put in use depending the context of the app you are going to develop.
@headlights-go-up3 жыл бұрын
As someone new, you explained this so well. Thank you!
@hyperborean724 жыл бұрын
Why we can not process that math calculation 4:25 asynchronously the same way as io calls? Is it because this type of work is not delegated to some external service?
@keshavrastogi50054 жыл бұрын
that was really great. I was confused whether to use node.js or not, but now I am clear :) Thanks! :)
@abdelmalek80454 жыл бұрын
What i retain is that Node is well designed for I/O intensive systems, certainly the reason of its success in widely used microservices architecures. Gonna learn it. Thanks!
@sarahchohan65833 жыл бұрын
Very well explained. After watching this video had subscribed to that channel for upcoming videos.
@ViralKiller Жыл бұрын
I guess you could use WASM for the processor intensive stuff
@hyperborean724 жыл бұрын
How nice that the color of your jacket is the same as the color of the font and the frame in your presentation
@erinmcgowan79804 жыл бұрын
The ammount of info in here is amazing =)
@alexisaddicted4 жыл бұрын
I think that for this video is great at explaining basic concepts in a simple way. Good job!
@kaleemullahnizamani74364 жыл бұрын
Loving you since your first video of servlets. You shine 😎
@KennedyEcheverry10 ай бұрын
very good explanation! Thanks.
@KuroManX Жыл бұрын
You can use the client side with some react/vue/svelt to handle complex calculation, it's not ideal, but can help
@sivakumarg983 жыл бұрын
hey nice explanation dude, specifically when not to use, lovely :)
@sumitdas-kr6fe4 жыл бұрын
Very good explanation.
@ankitkalavagunta8951 Жыл бұрын
Very well explained!
@anamolacharya8824 жыл бұрын
A simple question, Did you use Node.js to create javabrains.io ? If not which language was used to develop the site? That would be a great help for me if you share about it.
@Manana70162 жыл бұрын
I really appreciate your explanation! I’d love to hear your take on comparing node.js to other options like python, php, etc. But thank you again for this video.
@nicktheritter2 жыл бұрын
Really well done video. Easy to follow. You're interesting to watch. Useful information. Thank you.
@mujkocka Жыл бұрын
very nice videos. with a lot of design decision info. Devil is in the detail. so important.
@LunarcomplexMain4 жыл бұрын
So for an MMO, Node isn't / wouldn't be such a bad idea as long as keeping track of requests, responses, and other such actions (loops through any relevant entity like players, enemies, etc) are only done with small calculations?
@alexaneals8194 Жыл бұрын
I would add one misnomer about NodeJS is that it is single-threaded. You cannot have callback functions in a single-threaded app. If you look at the video where the original designer of NodeJS describes how NodeJS can mimic a single-threaded app, but have the ability to use call back functionality like multi-threaded apps. He explains that NodeJS hides it's multithreading by having the Message (or what is now called Event) loop running on a single thread. So, when you use async functions the event loop will hand them off to a separate thread to execute. This effectively hides the complexities of multi-threading from the users so that it appears as a single-threaded app. However, NodeJS is multithreaded under the hood.
@ramshankarkumar42222 жыл бұрын
this content is awesome!!🎉 Thank you so much 😀 Just one question -- In multi threaded programming language, how number of thread pool is defined? Is it predefined by language or is configured by developer only? In any case, what could be the maximum number of thread pool can be created? Is there any parameters for it? Please answer if possible. Thanks
@delavago53794 жыл бұрын
No offense but as a person from the Caribbean that normally needs a clear English accent to understand these videos your video was really clear and informative. Thank you 💕
@utkarshgupta29433 жыл бұрын
This content is really good
@RAVIKUMAR-hl3ik3 жыл бұрын
Thank you very much it really gave me clarity
@anasalhariri54742 жыл бұрын
Would Nodejs still blocking if you used an asynchronous function to calculate the lengthy operation using nodeJS?
@HadiAriakia4 жыл бұрын
Multi threading, multiprocessing, asynchronous are independent. Each processor can handle multi-threads which each thread could be asynchronous or synchronous
@linqcodmax89654 жыл бұрын
Good work! Can u make this kind of video about Django framework?
@user-to9gg1wm7v3 жыл бұрын
Thanks and I really like you work...keep it up .
@thanasisathanasi49654 жыл бұрын
You have a very cool personality and style that I like !!!
@bryanescobar22512 жыл бұрын
You are the best man!
@yassine_klilich3 жыл бұрын
i really enjoyed this explanation, love it
@jfpinero4 жыл бұрын
Just curious on your thoughts of using node.js these days over netcore 3+?
@TP_Raks4 жыл бұрын
The Hero we need but don't deserve. 😢Thank you so much good Sir. Great explanation
@iliyasmohammed61923 жыл бұрын
Thanks a lot for the explanation. Its really needed when diving into it.
@sarathchandran28153 жыл бұрын
Amazing presentation sir❤
@deepikagoyal154411 ай бұрын
Do u think it is a good idea to make a service which interacts with database in node js , and other services that need data can just interact with node js service .
@truth-12345.4 жыл бұрын
Single threaded? Will it be perfect for arm archeticture?
@sreerup_dhrino4 жыл бұрын
Simple loved it... Clear explanations with proper examples
@BenWeigt4 жыл бұрын
Holdup, node is not strictly single threaded. You can initiate your own threads via workers and there are many legitimately multithreaded optimisations under the hood (eg I/O).
@cruzortiz52334 жыл бұрын
Hi excellent resource, i have a question. When talking about node and that computing intesive task, are things that node isn´t good for, i was wondering, about promises ?. If we wrap that computing intesive process into a promise, we wont block the main thread and we can still be able to build those types of app ?
@Samuel-ql7tq4 жыл бұрын
Cruz Ortiz No, promises are nothing but a syntactic sugar on top of callbacks so it basically means whatever computation heavy task you wrapped inside promises still have to be executed by node’s main thread only
@kumailn76623 жыл бұрын
When you saying cpu intensive work can't be done in nodejs, why not mentioned we could make use of worker threads?
@Martin9583 жыл бұрын
Asynchronous JavaScript can be thought of like a rugby player handing off the ball to a team mate (the event loop), then running forwards without it, then receiving the ball back again. (That's the runtime if you like). Multi-threaded is more like a player tucking the ball under their arm and barreling forwards alone which takes more energy to do. But then there are many players running forwards with the ball in multi-threading so the analogy with rugby breaks down here. So multi-threading still works well.
@milindpatel99474 жыл бұрын
Hi, I'm node js developer, I have a question. Can we use async await or promises or callbacks for data calculations, processor intensive and blocking operations in node js?
@TheGaridi24 жыл бұрын
I think it shouldn't be used in cpu intensive tasks
@MoolshankarTyagi4 жыл бұрын
Yes, you can. Thats why Node.js is still in market.
@DC-tq6nd4 жыл бұрын
No. To do this you should use the recently introduced worker threads, to prevent the processing from blocking your main thread.
@chigozie_jesse4 жыл бұрын
What if you wrap the calculation intensive operation in async function? What about languages that can multi-threads with async functionalities?
@deepak33034 жыл бұрын
It queues up async functions. The best thing you can do it offload the work to host OS with worker threads.
@sathieshmkumar65634 жыл бұрын
Is node.js good to build an app that invokes Elastic search. Our app often fails when there are huge number of search queries sent to ES server, it uses web sockets and easily runs out of the few thousand sockets
@syedkounainabbasmashaddy99363 жыл бұрын
I need to build an health care application where n number of people will be hitting our server like patient, doctor, nurse, frontoffice and more roles added. Is it good to go with nodejs or php. Where my application will also have calculation of all the patient history, employees pay roles and more.
@abhay3545 Жыл бұрын
Can u explain the performance difference between node with workers if I utilise all the cores and true multi threaded languages like Java...btw it was a great video🙂
@minch253 жыл бұрын
Are there any platforms that are multithreaded and each thread uses an event loop? Wouldn't that be the best of both worlds?
@RamKumar-rg3gr4 жыл бұрын
Sir then Os internally allocates threads to multiple callbacks.
@mib34294 жыл бұрын
Awesome explanation. A comparison with Spring Boot would be even more meaningful specially for the peoples' following you from Java background. That way, people can relate more about which framework* excels on what. * just saying nodejs a framework to generalize things. I'm aware its a run-time and not a framework per se.
@spandiar4 жыл бұрын
my thoughts too exactly
@gibranmohammadkhan62164 жыл бұрын
Please do a series on Design Patterns, if possible. Thanks
@FedJimSmith4 жыл бұрын
very nice explanation
@FG-qs8uj4 жыл бұрын
I don't understand the for loop example. Wouldn't that be single threaded on any language? When you say a thread is that the same thread that CPUs mention in their specs?
@wontonfuton4 жыл бұрын
Would I be correct in saying that NodeJS handles jobs equivalently as using SelectionKey and Selector in java?
@mkhalidumer4 жыл бұрын
can you please suggest, what should be used Where nodejs is not a good option ?
@aniruddhabasak74413 жыл бұрын
Great explanation. But one thing I have in my mind that, I think multi threaded can also be asynchronous. Then what's the point of using node js if we already know a multi threaded programing language? My question is, is there anything that node js can do but a multi threaded program with asynchronous can't?
@theyliketo4 жыл бұрын
You can make long computations non-blocking, too, if you use async generators. It's a bit more involved and it's probably not something you'd get into in a "basics" video, but it wouldn't be fair to convey that Node.js is decidedly helpless against these kind of workloads.
@eny11034 жыл бұрын
Thank you for this video! It was very informative!
@m1dway4 жыл бұрын
What if you wrap intensive processing in a promise? Will it still blocks?
@FG-qs8uj4 жыл бұрын
You could use node js for blocking operations if you create copies of the node process, is that right?
@lifedatatech69174 жыл бұрын
Great explanation!
@keshavkumar83853 жыл бұрын
explained really well ❤️
@David-kg5nn4 жыл бұрын
Thanks for this. I really enjoy the long form, in-depth discussion on one topic.