The Real Hidden Cost of a Request

Sdílet
Vložit
  • čas přidán 12. 12. 2023
  • In this video I explore the hidden costs of sending a request from the frontend to the backend
    More details here
    / the-journey-of-a-reque...
    Discovering Backend Bottlenecks: Unlocking Peak Performance
    performance.husseinnasser.com
    Fundamentals of Backend Engineering Design patterns udemy course (link redirects to udemy with coupon)
    backend.husseinnasser.com
    Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)
    network.husseinnasser.com
    Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
    database.husseinnasser.com
    Follow me on Medium
    / membership
    Introduction to NGINX (link redirects to udemy with coupon)
    nginx.husseinnasser.com
    Python on the Backend (link redirects to udemy with coupon)
    python.husseinnasser.com
    Become a Member on CZcams
    / @hnasr
    Buy me a coffee if you liked this
    www.buymeacoffee.com/hnasr
    Arabic Software Engineering Channel
    / @husseinnasser
    🔥 Members Only Content
    • Members-only videos
    🏭 Backend Engineering Videos in Order
    backend.husseinnasser.com
    💾 Database Engineering Videos
    • Database Engineering
    🎙️Listen to the Backend Engineering Podcast
    husseinnasser.com/podcast
    Gears and tools used on the Channel (affiliates)
    🖼️ Slides and Thumbnail Design
    Canva
    partner.canva.com/c/2766475/6...
    Stay Awesome,
    Hussein
  • Věda a technologie

Komentáře • 54

  • @hnasr
    @hnasr  Před 5 měsíci +9

    Head to backend.win to grab my fundementals of backend engineering course

  • @supernovaw39
    @supernovaw39 Před 5 měsíci +16

    I absolutely love how you get to the bottom of how things work and strive to never forget or omit the low-level details. For some reason it's really uncommon compared to using things without asking any questions. That is what makes going through the education system so frustrating to me, dogmatic thinking. Your channel is one of my favourites because of this spirit of curiosity. Keep up the good stuff

  • @user-qk8oh5td1g
    @user-qk8oh5td1g Před 5 měsíci

    Really love how amazingly complex this request is and we ignore this. Amazing show video.

  • @bellybooma
    @bellybooma Před 5 měsíci +2

    Really like this. All the abstractions and libraries these days are a double edged sword. Yes you can develop faster, but you are also less aware of what is actually happening computationally.

  • @HarshKapadia
    @HarshKapadia Před 5 měsíci +1

    Nice! Thank you Hussein!

  • @megamind452
    @megamind452 Před 5 měsíci +6

    Nice video, while you were explaining it triggered me the thought of how you handle race conditions if the previous request is waiting and then the next request do some changes in db which first checks in db for an early entry by a call to db. But in second request the things have changed and check which was to be made in db is now bypassed by race conditions or fast multiple requests. I hope this makes sense.

    • @hnasr
      @hnasr  Před 5 měsíci +7

      aha good point,
      I can speak to Javascript which is the easiest, but other languages can do it differently and it get complicated with multiple threads where a mapping table may be required.
      when a request is manifested (right after parse step) a function call is invoked (the callback that is (req, res) those two objects fully populated (client connection)
      every HTTP request the server gets eventually invoked a function with two local stack vars request and response objects both has reference to the frontend connection (or stream in case of h2). you process the request asynchronous by reading from file async or network to the backend your function gets on pause until you get a callback from the asynchronous read operation and meanwhile your main thread gets another request which invokes another function with its own request and response objects , you also do the same thing you call an async function to do a read and meanwhile you all of a sudden receive a callback from the first request, which the puts you (thanks to javascript closures) back to request 1 and response 1 objects its as if javascript engine sets your state back with all variables to that first request and now you have read the file so you use the response object to write back the response and you will be using the correct object.
      this is where the power of the language helps, but you can of course not relay on the language and use your own global table and relay on that for lookup.

  • @srihari5605
    @srihari5605 Před 2 měsíci

    Go through the medium article and pen down it somewhere after having a look at this video. Really informative.

  • @sherifalaa5
    @sherifalaa5 Před 5 měsíci +5

    Great video, I'd love if you dive deeper into how processes is handled and the resources they consume, especially capacity planning

    • @sidheshwartiwari9834
      @sidheshwartiwari9834 Před 5 měsíci

      You seem to be more interested in system design.. give that a try.

  • @IntenseWebs
    @IntenseWebs Před 5 měsíci

    Good video topic and AWESOME Cow-lick on the hair!

  • @elvispalace
    @elvispalace Před 4 měsíci

    this channel is so underrated

  • @mti2fw
    @mti2fw Před 4 měsíci

    Awesome!

  • @rick-kv1gl
    @rick-kv1gl Před 5 měsíci

    love it.

  • @testemail2155
    @testemail2155 Před 5 měsíci

    I have a problem to solve around something similar, to determine if I have recieved a similar (not same) request based on some parameter / data in the last request for that subject, to decide should I let it through or not (if its a duplicate/something that doesn't add anything new to update on the items my downstream is interested in).
    Again this can lead me to race conditions, where by the time I am at the stage of deciding this present request is duplicate, another duplicate comes at the top when I search the stack.

  • @btom1990
    @btom1990 Před 5 měsíci

    @hnasr you should do a video covering L4S aka RFC 9330. This is IMHO a gamechanger in the fight against bufferbloat and high latencies.

    • @hnasr
      @hnasr  Před 5 měsíci

      interesting thanks will check it out!

  • @shapelessed
    @shapelessed Před 5 měsíci +1

    I won't lie.
    Sometimes it's best to create a websockets request/response type of simple protocol for your needs and do much of the requests through it instead of fetch/ajax.
    Way lower latency, no overhead for handshakes, etc. If you're really crazy about it, you can just as well stream images and media like that.

    • @chebrubin
      @chebrubin Před 5 měsíci

      Hussein has his opinions on Websockets. Check his recent videos. Websockets is a browser implementation that opens a dedicated stream separate from the noisy ongoing request fabric of the browser window object. Definitely has its purpose.
      This media discussion today is more focused on just HTTP request; not only as a front end traffic. Just in general. I agree a backend established websocket session could be great but not sure from a JVM perspective that is going to scale to handle + 1,000 distinct websocket 1:1 conversations.

  • @mohammedabdulbary1577
    @mohammedabdulbary1577 Před 5 měsíci

    I thought you will start from the point where the client start to make the request obj we have also a lot of steps to go through until we get the request to be in the wire

  • @kiang.9237
    @kiang.9237 Před 5 měsíci

    Thank you Hussein! one question: out of all the stages, would decryption be the slowest?

    • @freecelpip
      @freecelpip Před 4 měsíci

      Nice question I think it is cause the server has to do some computing to decryption and I guess for the response it has to a whole lot of encryption before passing it down to the Network interface

  • @RealYukiSan
    @RealYukiSan Před 5 měsíci

    Talk about SNMP (Simple Network Management Protocol) please ^^

  • @kdcapparelli
    @kdcapparelli Před 5 měsíci

    It resembles Star Trek's teleportation, as the request de-materialize in one end, travels through space, and re-materialize in other point (address) ... 😊
    But, by all means, what is then the real cost of a request (in dolar, per request), approximately ? 🤔

  • @leojohn6702
    @leojohn6702 Před 5 měsíci

    Can you explain system design diagrams at least in a conceptual level?
    I am an aspiring backend developer, and I find myself building more and more complex (at my level) functions. But each time when I do some basic flow, I find myself doing different implemwntation

  • @gibraanjafar1669
    @gibraanjafar1669 Před 4 měsíci

    Hussein, why do you have 2 copies of Steve Jobs by Walter Isaacson on your bookshelf behind you? Isn't that redundant? I noticed it today while watching the Caching Techniques video of yours from 3 years ago. :D

    • @hnasr
      @hnasr  Před 4 měsíci

      Haha I do, I don’t love him that much, I just ordered one and got an extra copy so I now have two.

  • @VasileSurdu
    @VasileSurdu Před 4 měsíci

    Please do a video about webhooks

  • @maithammansoor9566
    @maithammansoor9566 Před 5 měsíci

    Make your messages short and simple

  • @rajashekhar433
    @rajashekhar433 Před 5 měsíci +1

    1. Do you have any course to become a good nodejs developer with mongo?
    2. Basics of system design

    • @vickylance
      @vickylance Před 5 měsíci

      Check out his udemy courses

  • @Meisterilyas_333
    @Meisterilyas_333 Před 13 dny

    🎉

  • @ronsn8071
    @ronsn8071 Před 5 měsíci

    2:49 (with headphones on) 😂

    • @viacheslavnovakovskyi6895
      @viacheslavnovakovskyi6895 Před 4 měsíci

      What makes you positive?

    • @ronsn8071
      @ronsn8071 Před 4 měsíci

      @@viacheslavnovakovskyi6895 His facial expression just before he farts^^

    • @viacheslavnovakovskyi6895
      @viacheslavnovakovskyi6895 Před 4 měsíci

      @@ronsn8071 why do you think that he do that?

    • @ronsn8071
      @ronsn8071 Před 4 měsíci

      @@viacheslavnovakovskyi6895 Why he did fart in the video? I don't think he was even aware of it at the time, he was concentrating on what he actually wanted to say. And he probably didn't realize it later when he was editing the video. But if you have headphones on, you can clearly hear it. ... and you can see it in his facial expression. :D

  • @mohsinali8450
    @mohsinali8450 Před 5 měsíci

    How is here after ezisnapet video😅

  • @JamieTransNyc
    @JamieTransNyc Před 5 měsíci +41

    After 5 minutes of waiting for you to get to the point of this video... I gave up and clicked to another video.

    • @NN-qj4sk
      @NN-qj4sk Před 5 měsíci +4

      Ok smart boy

    • @jay_wright_thats_right
      @jay_wright_thats_right Před 5 měsíci +4

      Yeah, this guy never wants to get to the point. LOL

    • @obaid5761
      @obaid5761 Před 5 měsíci

      Weird way to say ur slow and retarded, Jamie. But you do you ig.

    • @beneditomauroo
      @beneditomauroo Před 5 měsíci +7

      Yes, it’s a fair criticisms of Hussein

    • @alexandrep4913
      @alexandrep4913 Před 5 měsíci +8

      What do you mean? Just because you don't know what he is talking about, doesn't mean he didn't address this in the first 2 minutes.
      TCP, ssl, serialization and processing.

  • @mmm-ie5ws
    @mmm-ie5ws Před 5 měsíci +1

    you talk way too slow, even at 2x you sound slow. Please improve your speech.

    • @mateoceballos
      @mateoceballos Před 5 měsíci +1

      Nah I really appreciate the way he talks, also while the video is way too long it is nice seeing someone explaining his way of understanding things

  • @4747surya
    @4747surya Před 5 měsíci

    🎉