Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 เม.ย. 2020
  • In this video, I explain the main difference between asynchronous execution, multithreading and multiprocessing programming. There are advantages and disadvantages of each approach.
    * Synchronous 0:30
    * Multithreading a process have many threads shared resources 3:20
    * Async io single thread 6:00
    * Multiprocessing 11:00
    Threads are evil
    web.stanford.edu/~ouster/cgi-...
    🏭 Software Architecture Videos
    • Software Architecture
    💾 Database Engineering Videos
    • Database Engineering
    🛰 Network Engineering Videos
    • Network Engineering
    🏰 Load Balancing and Proxies Videos
    • Proxies
    🐘 Postgres Videos
    • PostgresSQL
    🚢Docker
    • Docker
    🧮 Programming Pattern Videos
    • Programming Patterns
    🛡 Web Security Videos
    • Web Security
    🦠 HTTP Videos
    • HTTP
    🐍 Python Videos
    • Python by Example
    🔆 Javascript Videos
    • Javascript by Example
    👾Discord Server / discord
    Support me on PayPal
    bit.ly/33ENps4
    Become a Patreon
    / hnasr
    Stay Awesome,
    Hussein
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Get my Fundamentals of Networking for Effective Backends udemy course Head to network.husseinnasser.com for a discount coupon (link redirects to udemy with coupon applied)

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

      Man you should start a podcast for this stuff, just put some of it on spotify for us to listen to it in the background. You are so good at explaining these things in such a casual way that you are kinda having a conversation rather then just explaining, thats a real skill. Would love some of this on spotify to listen to while just cleaning up and stuff.

  • @venkyman4985
    @venkyman4985 3 ปีที่แล้ว +76

    Him: does anyone even print stuff these days
    The books behind him: ...

    • @hnasr
      @hnasr  3 ปีที่แล้ว +23

      You got me

    • @ahmedmalakai9753
      @ahmedmalakai9753 2 ปีที่แล้ว

      You probably dont care at all but does anyone know of a trick to get back into an Instagram account..?
      I was dumb forgot the password. I would appreciate any assistance you can give me!

    • @hacker64xfn99
      @hacker64xfn99 2 ปีที่แล้ว

      @@ahmedmalakai9753 If u still did not get back to ur account, it is as simple as clicking forget the password and that will send an email to ur gmail and then create new one for that instagram account !

    • @emonymph6911
      @emonymph6911 2 ปีที่แล้ว

      @@hacker64xfn99 dude probably forgot his youtube account as well lol

  • @yaBoyDreamer
    @yaBoyDreamer 3 ปีที่แล้ว +155

    I loved this explanation! You might consider doing a podcast when you just chill by yourself or with a guest and start off from some technical subject but treat it casually and with lots of everyday examples, just like you did in this clip. New sub from me and keep it up! :D

    • @hnasr
      @hnasr  3 ปีที่แล้ว +19

      dreamer ❤️ thank you for the suggestion ! Appreciate it and welcome to the channel!

    • @yaBoyDreamer
      @yaBoyDreamer 3 ปีที่แล้ว

      @@hnasr Glad to be a member of this community!

    • @rouabahoussama
      @rouabahoussama 3 ปีที่แล้ว

      @Hussein Nasser I would love to know your opinion about goroutines (Golang) and erlang process

  • @aadityarane3464
    @aadityarane3464 3 ปีที่แล้ว +10

    This is what they always told me at work, understand the basics, understand the basic.. and here I am always ended up getting confused in basic.
    And back to ur channel to relearn all those things

  • @goregeway8287
    @goregeway8287 3 ปีที่แล้ว +17

    I clicked the thumb up button after I watched the whole video, and I ended up given all video I've been watched a thumb up in this channel, thank you Hussein!

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

      jiaojie wei thumbs up to you dear 👍 and much love ❤️ thanks for your comments glad you enjoyed the content

  • @centurion3708
    @centurion3708 3 ปีที่แล้ว +33

    I just realized you've got a ps2 on the background, so many good memories of that console

  • @_0_o_924
    @_0_o_924 ปีที่แล้ว +6

    I don't think anybody can explain it in a more better way . Thank you

  • @kez99
    @kez99 3 ปีที่แล้ว +55

    i'm thankful to the people who suffered through callback hell

  • @BangMaster96
    @BangMaster96 3 ปีที่แล้ว +8

    Thanks to the geniuses who made coding so easier for us newbies in the 21st century. Imagine, having to code back in the 70's or 80's, with no software like VS Code that can color code your text, auto complete lines of code, spin up the compiler/interpreter with just a click of a button, handles the communication with the OS, does syntax error check, etc.
    All we have to do is just know how to and what to code.

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

      The systems we build now are much more complex 😉

    • @avg_user-ty2eg
      @avg_user-ty2eg ปีที่แล้ว

      @@hellowill aah yes the code monkeys making another useles webapp

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

    I love your explanations and as someone who is trying to become a backend engineer, I think your channel is a gold mine of useful information. Keep up with awesome videos!

  • @ahmeddaraz8494
    @ahmeddaraz8494 4 ปีที่แล้ว +14

    multithreading languages tend to solve the problem by introducing reactive programming, Java did this after the community introduced some technologies like RxJava. and it is very power to combine both in the language echo system. however hard to perceive from the first glance. Great video buddy, all my wishes to you.. keep up bro

    • @hnasr
      @hnasr  4 ปีที่แล้ว +4

      Ahmed Daraz thanks Ahmed for the insights! Well said

  • @avalon2199
    @avalon2199 2 ปีที่แล้ว

    Clear and concise explanation, proof that we don't need beautiful architecture drawings when concepts are clear.

  • @icbm7
    @icbm7 3 ปีที่แล้ว +3

    Great video, as usual.
    To summarize: if your app is "i/o bound" (e.g. reading data from a db, and sending it back) then use the asynchronous model (like NodeJS). If you are doing something "cpu bound" (e.g. video processing or cracking passwords) then use something supports subprocesses and channels (like golang).

    • @thatoneuser8600
      @thatoneuser8600 2 ปีที่แล้ว

      What do you mean by "and sending it back"? Unlike in real life, data can be in two places at once, so there's no need to send anything back

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

    Hussein the way you express yourself echoing in my mind. I like your passion and professional attitude which are seen rarely together man. True engineer

    • @hnasr
      @hnasr  2 ปีที่แล้ว

      Thank you Mustafa for the kind words dear ❤️

  • @liquidpebbles
    @liquidpebbles 3 ปีที่แล้ว

    Man, I love the enthusiasm you bring to the field!

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

    You're a really good teacher. I admire your talent sir!

  • @simplefinance5165
    @simplefinance5165 2 ปีที่แล้ว

    Love all your videos, specially about soft skills and motivation one. There are times when I get lost and watching these videos again put me on track and keep going.

  • @tljstewart
    @tljstewart 2 ปีที่แล้ว

    Loved this video, the last half of this video could definitely make a great series on ways to use multiprocessing!

  • @shahbazzaidi650
    @shahbazzaidi650 3 ปีที่แล้ว

    This was really helpful, informative and to the point. Thanks !

  • @ravisomvanshi1072
    @ravisomvanshi1072 3 ปีที่แล้ว +4

    First time I felt myself laughing at a programming tutorial/explanation. Thank you for this video!

  • @raivatshah7781
    @raivatshah7781 3 ปีที่แล้ว +1

    Very informative and intuitive explanation! Thanks so much

  • @anzwertree
    @anzwertree 2 ปีที่แล้ว

    This dude rocks. He talks in a way I can understand, and he's not boring.

  • @hassanhammoud754
    @hassanhammoud754 2 ปีที่แล้ว

    This is great man, I like your style of teaching! I kind of revise this topic once in a while and I'm going to bookmark this video so I revisit it later on.

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

    This was a good watch. I think I see single-threaded async behavior differently now. I am now also very interested in process interop now.
    Most of all, I have a weird urge to try working with multiple asynchronous single-threads at the same time.....

  • @sundaramjha1776
    @sundaramjha1776 4 ปีที่แล้ว

    Like to see u have very less subscriber, but still u r no bother about it.. u just share very unique knowledge on this channel. Which i have never find on other channel. Thank You, keep continue. sharing is caring.

  • @dayvidkelly7683
    @dayvidkelly7683 2 ปีที่แล้ว

    Good video, I've a question about processing. let's say I've a node js code that sends some processing intensive calculation to another language for example python, will it run on another thread?

  • @tahirraza2590
    @tahirraza2590 2 ปีที่แล้ว

    loved the explanation - simple and concise

  • @amankapoor7665
    @amankapoor7665 2 ปีที่แล้ว

    Amazing explanation. Really cleared a lot of doubts.

  • @rohanmainali9040
    @rohanmainali9040 ปีที่แล้ว

    Hey Hussain, Thanks for clearing all the doubts and great explanation, absolutely loved it♥️ especially the event loop 🙂

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

    I just can't stop watching your videos man .... Keep them coming !

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

      Thanks! Enjoy 😊

  • @IvanStipic_Stiiv
    @IvanStipic_Stiiv 3 ปีที่แล้ว

    Keep up the great work, man!

  • @minkymoo5773
    @minkymoo5773 2 ปีที่แล้ว

    You are such an amazing teacher!!!! I actually kind of understand this now, thanks so much!😍

  • @Abdullah-zc1uy
    @Abdullah-zc1uy 3 ปีที่แล้ว +2

    I agree, multithreading is hard to code but it's worth doing especially if you combine it with asynchronous execution
    you will have the most responsive, memory-efficient application
    I'll go with multiprocessing only when execute a rarely use case with heavy logic

  • @leoniemargetich3062
    @leoniemargetich3062 3 ปีที่แล้ว +6

    This is hilarious! Please make a podcast - i'd love to wake up to you talking about any programming related topic haha XD

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

      ❤️ anchor.fm/hnasr

  • @jaswalankit5494
    @jaswalankit5494 3 ปีที่แล้ว

    Well, The best explanation I see in my whole life, till today

  • @wafleez0r
    @wafleez0r 3 ปีที่แล้ว +6

    welp i just got addicted to this channel i guess

  • @UpupaAfricana
    @UpupaAfricana 4 ปีที่แล้ว +25

    Your videos are super great! But I prefer the one with graphics and drawings, because I can understand and memorize better informations

    • @hnasr
      @hnasr  4 ปีที่แล้ว +13

      Lahdili Zuhir thanks! I agree with you too. I am experimenting with different formats. And i want mix both drawing and talking head 🗣👍

    • @livesamarth
      @livesamarth 3 ปีที่แล้ว +1

      Yes exactly

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

      @@hnasr Even Khan Academy style drawings are good or even basic white board. I feel when things are explained with visuals and the key points are written down then it's easier to absorb the information

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

    The most amazing, funny, useful. programming information video without coding I have ever seen until now. Amazing brother.

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

    excellent approach & good humor to explain complex topics in a simpler way.

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

    this is the first time I smiled the whole way through a technical video :)

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

    I think you can mix asynchronous and multiprocessing. I did something like that with fastapi using asynchronous functions and a Procfile with different microservices running on different ports

  • @swathidesai
    @swathidesai 3 ปีที่แล้ว +7

    I guess proxies interest you more than anything (They come up at least once in every video of yours) !!!..Btw, I am a fan, and Thank you for the great content

  • @romantsyupryk3009
    @romantsyupryk3009 3 ปีที่แล้ว

    Thanks so much for this video tutorial.

  • @rohitsagar9011
    @rohitsagar9011 3 ปีที่แล้ว

    so can we make any code asynchronus or mulithreading or it depends on the language or i did not understand whatever u said?

  • @oah8465
    @oah8465 3 ปีที่แล้ว

    Fantastic explanation. I sense some nginx prior tinkering which got you into this stuff. If you take a deep dive on the read modes async io, direct-io your audience will get much more value. Bravo and keep them coming.

  • @igbana
    @igbana ปีที่แล้ว +1

    I did it.... Syntactical sugar😂😂... I love your explanation man.... We are the new generation where we don't write multithreading or async code, we IMPORT libraries to do it for us😂✌️

  • @osamaa.h.altameemi5592
    @osamaa.h.altameemi5592 3 ปีที่แล้ว +2

    As usual fantastic video Hussein but in multi-processing we have to go with IPCs and the like and we will lose the shared memory space (which exists in multi-threading) among the threads. That is one key need in problems that involve high real-time update-rate. I see what you are saying about the locks and all the headache that comes with them and you nailed it there.

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

      Well said Thanks Osama, good points, one slight addition; you can have shared memory between different processes (postgres is an example) of course you have the same trouble of managing the shared memory

    • @osamaa.h.altameemi5592
      @osamaa.h.altameemi5592 3 ปีที่แล้ว +1

      @@hnasr you got it right Mr. I usually go with Redis for more or less and have all my global "shared" variables there. If you are aware of faster alternatives, I am all in. Thx again.

    • @osamaa.h.altameemi5592
      @osamaa.h.altameemi5592 3 ปีที่แล้ว +1

      @@hnasr what do you think of green-threads used in Go and all the collaborative scheduling that comes with them. I am planning on taking a deep dive there once we deliver the current project.

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

      Not familiar with Go but heard really good things how Go was built for networking and threading in mind to make it really easy

    • @osamaa.h.altameemi5592
      @osamaa.h.altameemi5592 3 ปีที่แล้ว +3

      @@hnasr There is one fantastic talk i recall watching I guess in 2018, it is called the "way of Go" or the "why of Go", highly recommended.

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 3 ปีที่แล้ว

    Amazing as always ❤

  • @jrdtechnologies
    @jrdtechnologies ปีที่แล้ว

    Excellant explanation, very engaging and concise!

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

    Hey Bro. I've been following your videos to understand the basic concepts of Infrastructure and your explanation is amazing, and I have a couple of questions for you if you would like it to clarify for me. In synchronous communication, you mention that when a single process starts, it has a single thread that it uses to trigger the instructions and just wait there for the data but the same thread can be used to spin up multiple threads to execute other processes and get the results but at the backend, they use the same threaded. So it's like a highway tunnel for all other shortcuts and every thread is getting different results and passing back the result in the highway to the processes. Our main thread is not blocked as multiple results are coming back and we are executing the multiple processes over a single thread. I think it's not as evil as you think it is as it is also a form of asynchronous transmission. We are not letting our thread sit idle but rather triggering multiple processes over a single channel and waiting for the callback and the thread is busy working for other processes. Isn't this the same idea behind asynchronicity? if yes, then how we do differentiate between asynchronous and a multi-threaded process as both use the same single thread? Of-course the method is different for both but at the core, isn't both are using the same principles?
    I would really love your feedback over this and correct me if I am wrong about it as this is how I understood your multi-threading explanation.

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

      He sort of explains that the motivation for async in a language like JavaScript is to provide similar functionality to multi-threading without forcing the coder to be responsible for ensuring the resources that the multi-threaded process share are used correctly. This makes developing responsive UIs much easier as developers don't have to think about multiple threads, just the single thread and managing async calls.
      I think there are some helpful illustrations in this video th-cam.com/video/olYdb0DdGtM/w-d-xo.html&pp=gAQBiAQB
      If you read through the comments there's a great explanation on multiple threads trying to access the same memory that is allocated to the parent process. It essentially says that a process is allocated a set amount of memory (in simple terms basically think of it as an array). If multiple threads happen to try to write data to the same index in that 'array' of memory (because the programmer was not clever enough to avoid this) you now have unpredictable/unsafe behavior for the rest of the execution of the process because one thread is expecting one value and the other is expecting a different value.
      There are certainly other real-world use cases for multi-threaded applications, they seem to be related to much lower-level programming (lower meaning closer to the hardware)

  • @user-jf3gr2ht3s
    @user-jf3gr2ht3s 2 ปีที่แล้ว

    Good Explanation!Finally understand these concept quick and good.

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

    which one of the above is better and faster in terms of for performing operations on pandas dataframe & insert those into multiple tables of a database, can anyone please guide me on this

  • @jojojawjaw
    @jojojawjaw 3 ปีที่แล้ว

    GREAT TUTORIAL! thank you

  • @naimulmushfiq1390
    @naimulmushfiq1390 ปีที่แล้ว

    This explanation was something else.....
    Thanks man!!!!!

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

    I love your explanations! Excellent food for thoughts.

  • @mhmdshaaban
    @mhmdshaaban 3 ปีที่แล้ว

    Any recommendation for good resources about the operating systems.

  • @RobertTheUser
    @RobertTheUser 2 ปีที่แล้ว

    So... going with your recommendation of multiprocessing... how do you accomplish that in C#? do you have a video on that?

  • @dexteraparicio6808
    @dexteraparicio6808 ปีที่แล้ว

    In your explanation of asynchronous non-blocking flow while waiting for an I/O response, the single-threaded flow does not wait and continues to go on. If the one and only thread did not block and it continues to go on, how is the I/O response got detected? Does it spawn another thread to detect the I/O response? Or does is the one and only thread doing context switching back and forth?

    • @hnasr
      @hnasr  ปีที่แล้ว

      A good example is nodejs, it is a single thread that does an event loop. The thread sends to IO request and moves on to do something else, then it comes back to check if it got a response (polling) the OS. It gets complicated depending on the type of async io the OS supports. Recent linux io_uring is a game changer.
      This video might clarify
      th-cam.com/video/gMtchRodC2I/w-d-xo.html

  • @maedehshahabi4744
    @maedehshahabi4744 ปีที่แล้ว

    Thank you very much Hussein, that was a clear explanation.

  • @newtonsarr1234
    @newtonsarr1234 3 ปีที่แล้ว

    Amazing explanation !!!

  • @rouabahoussama
    @rouabahoussama 3 ปีที่แล้ว

    @Hussein Nasser I would love to know your opinion about Golang (goroutines) and Erlang ( process ), and about node I think that it is a master - workers model the master is the app thread and workers are those who do the job behind the scenes. Thank u for the video

  • @nishatnasir7991
    @nishatnasir7991 3 ปีที่แล้ว +1

    Best teacher.

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

    Hey Hussein, great talk! and thank you for the detailed basics which actually I missed learning (I guess I was on leave on those classes :D) Is multiprocessing possible in NodeJS ? and how?

  • @socksincrocks4421
    @socksincrocks4421 2 ปีที่แล้ว

    Thanks Nasser. Just getting my feet wet with programming, python, turbo_flask, and threading. I appreciate your explanation.

  • @RITWIKTIWARI24
    @RITWIKTIWARI24 3 ปีที่แล้ว

    Hi Hussein, the example you gave of brute force using multiprocessing. Is it applicable for multi-threading too? I mean if thread 1 accesses from A-E from the rainbow table, thread 2 accesses from F-J and so on...
    This is possible I guess... and will it be still thread safe?

    • @hnasr
      @hnasr  3 ปีที่แล้ว

      It is applicable in multithreading yes

    • @RITWIKTIWARI24
      @RITWIKTIWARI24 3 ปีที่แล้ว

      @@hnasr okay thanks!

    • @gsb22
      @gsb22 3 ปีที่แล้ว +3

      Every multiprocessing code can be changed to multithreading but you might not get the same benefits.
      So for this use case of brute force, which is CPU heavy operation, let's say you spin up 10 threads within a single process which is running on octa core computer. In that scenario, your application is using only 1/8 of your computing power and then dividing it into 10 threads amd in reality your cpu is underutilized.
      What you could do is spin up 8 processes and then have each process spin up few threads and in this way you get the best out of your cpu

  • @AlvaroALorite
    @AlvaroALorite 2 ปีที่แล้ว

    Thank you for this video!

  • @sajad2126
    @sajad2126 ปีที่แล้ว

    Amazing video, finally i learned this topic.

  • @yashgaur9619
    @yashgaur9619 3 ปีที่แล้ว +3

    Imagine him being your mentor! Freakn amazing,

  • @adityanagesh4922
    @adityanagesh4922 3 ปีที่แล้ว

    Great content!
    However, not sure if we could say event loop > multi threading.
    Is it possible to have the performance advantage of multi threading (parallel processing) in event loop based approach?
    Golang is known for its multi threading.

    • @RationalDissonances
      @RationalDissonances 3 ปีที่แล้ว

      I think with Nodejs clustering you could achieve this. run an event loop on each thread of the CPU as a child node

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

    Very nice explanation! Thank you for this video!

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

    جزاك الله خيرا ❤️ Thanks

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

    Does i/o controller need different thread if yes then asynchronous == mulithreading?

  • @masibhai339
    @masibhai339 3 ปีที่แล้ว

    I love to watch your videos, they are very informative. You could start a facebook group or slack group and ask people to join it.

  • @sfsf285
    @sfsf285 3 ปีที่แล้ว +1

    Awesome video, thanks man.

  • @parasarora5869
    @parasarora5869 3 ปีที่แล้ว +1

    Great explanation sir. I like the idea of multiprocessing !!! though never used :p

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

    Great intuitive explanation !

  • @dharshan117
    @dharshan117 ปีที่แล้ว

    Thanks Hussein for this content. Keep the good work going.....

  • @pikachuverun2062
    @pikachuverun2062 ปีที่แล้ว

    Wow, buddy, it is an amazing explanation. You are awesome!

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

    I have to disagree about staying away from multithreading. They have their own use context, with their pros & cons of course. And so it is that they came up with worker threads in nodejs. But I liked your explanation. Really funny the js event loop part. Regards!!!!

    • @hnasr
      @hnasr  3 ปีที่แล้ว +1

      Alain Perez thanks Alain! Loved your point of view

    • @alainperez3778
      @alainperez3778 3 ปีที่แล้ว

      @@hnasr I have become a huge fan of your videos 😊😊😊😊😊

  • @dorbenmoyal7639
    @dorbenmoyal7639 2 ปีที่แล้ว

    Great explanation 👌🏼

  • @Rezthm
    @Rezthm 2 ปีที่แล้ว

    So good explaination ❤️

  • @satyajitkamble1646
    @satyajitkamble1646 4 ปีที่แล้ว

    Hi Hussein, can you make a video on delete/put API endpoint design? For ex: If I am designing an API endpoint to add a user review...what endpoint should I hit? Would it be better for a put request to "/reviews/:reviewid" or would it be better to do a put request to "/users/:userid/reviews/:reviewid...what would be the pros and cons of both these design decisions?

    • @hnasr
      @hnasr  4 ปีที่แล้ว +1

      Hey Satuajit good question! Since you are building a REST api you post to a resource. i would imagine GET /users/1/reviews will give you reviews for user 1. If you PUT /users/1/reviews that will create a new review entry for user 1. This way the same URL is shared for Read and write
      There is no best practice as far as I know except ease of documentation ..

    • @SivaKumar89
      @SivaKumar89 4 ปีที่แล้ว +1

      Your asking about the difference between having a resource as a collection and having it as a sub-collection in another resource.it depends on your domain and access pattern. Consider if you want to fetch all reviews when you fetch the user as well. Do you want reviews to exist in their own right? If so, then you'd be better off adding them as a separate collection.

    • @hnasr
      @hnasr  4 ปีที่แล้ว

      Excellent point Siva! I didn’t pay attention to the group. For sure it matter and could yield significant performance picking one over the other...

  • @urounofficial1232
    @urounofficial1232 ปีที่แล้ว

    One of the best explanations i have ever seen on these concepts...
    I have a doubt sir, sorry this seems like a silly question but how does Node.js use multicores in CPU as it is single threaded? ...does it use only one core 😅?

  • @bhavyaagrawal4050
    @bhavyaagrawal4050 3 ปีที่แล้ว

    Very good explanation.. Don't know why so less thumbs-up

  • @mariometushev4563
    @mariometushev4563 ปีที่แล้ว

    Very very good explanation, congratulations!

  • @sauravdeb7412
    @sauravdeb7412 3 ปีที่แล้ว

    A technical Craig Ferguson! Loved it.

  • @davida.7586
    @davida.7586 3 ปีที่แล้ว

    Super explanation!

    • @hnasr
      @hnasr  3 ปีที่แล้ว

      David A.

  • @christianorlandoibarragarc3904
    @christianorlandoibarragarc3904 2 ปีที่แล้ว

    Nice explanation man, You have 1 new subscriber 👍👍👍

  • @azizulhakim1534
    @azizulhakim1534 2 ปีที่แล้ว

    Best explanations ever.

  • @contriveai8744
    @contriveai8744 2 ปีที่แล้ว

    Do you know any Udemy Courses(or any Coursera, EDx) which we can take to get better on this?

  • @pradnyas8898
    @pradnyas8898 4 ปีที่แล้ว

    can you shed some light on how multithreading and multiprocessing is implemented differently in nodejs for scaling and which is better?i know about a cluster module which can spawn up multiple child processes.when do we need multithreading in nodejs?

    • @hnasr
      @hnasr  4 ปีที่แล้ว +3

      pradnya s sure! I discussed multi processing in node js here -- Building a non-blocking multi-processes web server (Node JS fork example)
      th-cam.com/video/hmTl5Y4ee_Y/w-d-xo.html

  • @in4osports481
    @in4osports481 3 ปีที่แล้ว

    amazing yar...

  • @mostafaelgablawy164
    @mostafaelgablawy164 2 ปีที่แล้ว

    thank you so much for this good explanation

  • @ahtisham6597
    @ahtisham6597 3 ปีที่แล้ว

    Now I understand clearly why we use async and await thanks :) but i am using python instead of javascript and the technology is FastAPI it is pretty fast closer to Node js :D

  • @rodrigolabrador2745
    @rodrigolabrador2745 3 ปีที่แล้ว +1

    Hahaha the asynchronous unordered list on the 15 first seconds, nice touch 😂

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

    Good defs, BUT... ;) ... I agree w/the multi-threading bad rap... yes, you have to put some legwork in to get it working right because of easy resource access conflicts. Its not as hard as it sounds though once you understand it. BUT... once you do, this is the most performant way to write code. Mutli-processing is essentially multi-threading at a process level. So you do get the benefits of parallel execution and the speed. BUT, problem is, inter-process communication is SLOOOW. In olden days this was called Out-Proc, vs. In-Proc, was in-process communication. Essentially any communication within the same process boundary is the fastest there is. Any communication across process boundary is MUCH slower, by a factor of 100 or so. So there is a definite downside to multiprocessing vs. multi-threading, IF you want the processes to communicate a lot. If not, then its not an issue. Async/Await, is basically a cheap/simulated multithreading. Its maximizing the use of the single thread, which is awesome, but it will never be as efficient or powerful as multi-threading for obvious reasons. BUT, its the least people should do. Not doing it is stupid.

  • @section9999
    @section9999 3 ปีที่แล้ว +4

    In Spanish we have a word for people like you... Chingon! :D

    • @hnasr
      @hnasr  3 ปีที่แล้ว +1

      DataSurgeon 369 yay I just googled it and doesn’t mean loco 😍 thanks buddy

  • @ahmedembaby8230
    @ahmedembaby8230 2 ปีที่แล้ว

    عظمة
    كل عام وانتم بخير يا هندسة

  • @orion.5611
    @orion.5611 ปีที่แล้ว

    so a process is memory allocated to the program during execution

  • @zerefdev
    @zerefdev 4 ปีที่แล้ว

    The way you expalined js event loop was funny 😂
    You could use some graphics to help x)

    • @hnasr
      @hnasr  4 ปีที่แล้ว

      ZerefGG Now that I am watching it again I have to agree with you ! 😂 thanks for your comment!