The Real Hidden Cost of a Request
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
Head to backend.win to grab my fundementals of backend engineering course
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
Really love how amazingly complex this request is and we ignore this. Amazing show video.
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.
Nice! Thank you Hussein!
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.
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.
Go through the medium article and pen down it somewhere after having a look at this video. Really informative.
Great video, I'd love if you dive deeper into how processes is handled and the resources they consume, especially capacity planning
You seem to be more interested in system design.. give that a try.
Good video topic and AWESOME Cow-lick on the hair!
this channel is so underrated
Awesome!
love it.
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.
@hnasr you should do a video covering L4S aka RFC 9330. This is IMHO a gamechanger in the fight against bufferbloat and high latencies.
interesting thanks will check it out!
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.
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.
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
Thank you Hussein! one question: out of all the stages, would decryption be the slowest?
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
Talk about SNMP (Simple Network Management Protocol) please ^^
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 ? 🤔
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
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
Haha I do, I don’t love him that much, I just ordered one and got an extra copy so I now have two.
Please do a video about webhooks
Make your messages short and simple
1. Do you have any course to become a good nodejs developer with mongo?
2. Basics of system design
Check out his udemy courses
🎉
2:49 (with headphones on) 😂
What makes you positive?
@@viacheslavnovakovskyi6895 His facial expression just before he farts^^
@@ronsn8071 why do you think that he do that?
@@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
How is here after ezisnapet video😅
After 5 minutes of waiting for you to get to the point of this video... I gave up and clicked to another video.
Ok smart boy
Yeah, this guy never wants to get to the point. LOL
Weird way to say ur slow and retarded, Jamie. But you do you ig.
Yes, it’s a fair criticisms of Hussein
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.
you talk way too slow, even at 2x you sound slow. Please improve your speech.
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
🎉