When to use UDP vs TCP in Building a Backend Application?

  Рет қаралды 22,889

Hussein Nasser

Hussein Nasser

Күн бұрын

In this video I explain when to use TCP vs UDP as a communication protocol on your backend app. I go through the advantages and disadvantages of UDP I also discuss the protocol within the context of Chatting System, Multiplayer game, and building a browser and a web server
0:00 Intro
2:00 UDP
3:00 TCP
6:00 UDP vs TCP for Building a Chatting System
9:20 UDP vs TCP for Building a Multiplayer game
15:30 UDP vs TCP for Building a Browser and WebServer
19:11 Summary
🏭 Backend Engineering Videos
• Backend Engineering (B...
💾 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
Become a Member
/ @hnasr
Support me on PayPal
bit.ly/33ENps4
Become a Patreon
/ hnasr
Stay Awesome,
Hussein

Пікірлер: 67
@theSDE2
@theSDE2 2 жыл бұрын
i just love how your one video connects to other and it starts making more sense. Beautiful concepts and amazing explanation
@TestAutomationTV
@TestAutomationTV 3 жыл бұрын
IBM Aspera is a premium product built on UDP I guess. It is pretty expensive but fast. I work at a company that deals w large amounts of data. Good to know about the Quick protocol. I'll tell my manager about it. I am the test developer on the team, the ultimate decision will be in lead developer's hands and our manager's hands. Fun story, I teach TCP and UDP on Udemy so I am confident that I know some stuff about these. In a recent meeting our manager talked about building a desktop application for file transfer and maybe using TCP or UDP. I said nonchalantly "UDP is too unreliable for data transfer, yes it's fast but it'll screw up our files". The manager was so upset, I too gathered that my input was uncalled for and unwelcome. I reached him out after the meeting and said sorry. Not sharing links of my courses because I believe it will damage the purpose of posting this comment, want it to be pure haha.
@yodude2493
@yodude2493 2 жыл бұрын
Thanks man for videos
@abhishekgehlot2647
@abhishekgehlot2647 3 жыл бұрын
Thank you so much for this. Thanks to youtube algorithm that I found your channel. You're doing a great job. Explaining in such a smart and funky way. Love from india.
@norah5073
@norah5073 2 жыл бұрын
Your video always have fun :) Thank you for this video
@bobby9568
@bobby9568 3 жыл бұрын
Just what I needed, thanx!
@hnasr
@hnasr 3 жыл бұрын
Your welcome 🙏
@tahasaleh4697
@tahasaleh4697 3 жыл бұрын
Your videos are so good, you need your own subreddit!
@hnasr
@hnasr 3 жыл бұрын
Maybe one day!
@SachithNalakaMuhandiram
@SachithNalakaMuhandiram 3 жыл бұрын
one waited video, thanks for uploading...
@hnasr
@hnasr 3 жыл бұрын
Sure thing! Thanks for watching
@tonyramesh8184
@tonyramesh8184 3 жыл бұрын
thanks again ❤❤❤
@consistentlearners
@consistentlearners 11 ай бұрын
I am a great fan of you Hussein. I really appreciate your efforts in removing the idea of abstraction and making us how things work under the hood. I have been watching out your videos since 2021, I really loved your videos for focusing on the fundamentals instead of the fancy stuff.
@tambolaking5383
@tambolaking5383 3 жыл бұрын
I've been following you since you had a few thousand subscribers. the journey from 0 to a few thousand must have been very difficult for you. But I am impressed with the quality you bring now. Congratulations on close to 50k subscribers
@hnasr
@hnasr 3 жыл бұрын
Thank you for being a long time sub and for all your feedback ❤️
@andreytamelo1183
@andreytamelo1183 3 жыл бұрын
Super video! I applauded for $2.00 👏
@davidhsv2
@davidhsv2 3 жыл бұрын
Please don't forget the vulcain follow up. I'm tired of writing 5 endpoints for different representations of the same entity :( Love your work, cheers from Brazil
@SachinDolta
@SachinDolta 3 жыл бұрын
TCP-> foreplay Got it 👍
@moslehmahamud
@moslehmahamud 3 жыл бұрын
when he said foreplay i legit cracked
@serhiihorun6298
@serhiihorun6298 3 жыл бұрын
Cool, thanks
@saggitt
@saggitt 3 жыл бұрын
Great video, thank you! Suppose we do need raw UDP to quickly transfer game states from server to client. How would you structure that state, messages and their processing to minimize the effects of bad connection? Maybe you can point to some existing materials on this topic?
@toekneema
@toekneema 3 жыл бұрын
Great analogies
@rajeshkishore7171
@rajeshkishore7171 3 жыл бұрын
excellent
@vasuudayar3691
@vasuudayar3691 3 жыл бұрын
u r helping many beginner backend engineers thanks a lot.
@hnasr
@hnasr 3 жыл бұрын
It's my pleasure (L)
@artieedwards
@artieedwards 2 жыл бұрын
Brilliant, fucking beautiful lecture!!!
@viraj_singh
@viraj_singh 3 жыл бұрын
Very informative 👍
@hnasr
@hnasr 3 жыл бұрын
Viraj Singh 🙏
@vamsishankar2825
@vamsishankar2825 3 жыл бұрын
So UDP can be used for video streaming or voip like applications right? As there we can afford to lose some data while transmission
@rajatsharma8147
@rajatsharma8147 3 жыл бұрын
Amazing video. You videos help me to get the concepts easily. Need a video on SQL vs NoSQL.
@EddyCaffrey
@EddyCaffrey 3 жыл бұрын
Thanks 👍🏽. So HTTP/3 moving to UDP will come with some amazing improvement in efficiency 😉.
@hnasr
@hnasr 3 жыл бұрын
Yup killing this head of line blocking
@AbdullahAyyash
@AbdullahAyyash 3 жыл бұрын
Great video! I've seen two videos you did on QUIC in compression to HTTP2 and the possibility of using it to improve databases. Could you please make a video explaining QUIC in depth? How it works, when to use it and how to use it as an alternative to HTTP?
@hnasr
@hnasr 3 жыл бұрын
I still need to make that video yes! Still researching it but I think I am ready to make it 😊
@TestAutomationTV
@TestAutomationTV 3 жыл бұрын
Yah, still here bro! 😁
@chandandey8271
@chandandey8271 Жыл бұрын
Hi Hussein, Can you tell me why most of the databases are use TCP for communication. I heard the answer some of your video but forget. Can you tell me the answer one more time?
@johnalgozzini2165
@johnalgozzini2165 Жыл бұрын
I'm trying to use my tcp/udp app to determine what server I'm on in a certain game on xbox. I can use this on my pc but, how do I use it on my xbox if I'm using a VPN router connected directly with my router and xbox?
@ravitejavankam2977
@ravitejavankam2977 3 жыл бұрын
UDP will be useful for logistics tracking
@hackwithharsha5228
@hackwithharsha5228 3 жыл бұрын
Thanks Hussein !! Some Noob questions 1. If TCP is stateful, why HTTP is stateless which built on top of TCP ? 2. Does our HTTP status code depends on the acknowdedgment that server sends to client in TCP ?
@hnasr
@hnasr 3 жыл бұрын
HackWithHarsha good questions 1) HTTP is stateless and is built on TCP which is stateful. There is no state stored on the server at the application side for HTTP every request comes with all the information it needs. It just different design. HTTP always easier horizontal scalability, or if the server goes down and came back up the requests will still be served.. Check out my stateless vs stateful video 2) status codes have nothing to do with TCP its pure application level codes .
@hackwithharsha5228
@hackwithharsha5228 3 жыл бұрын
@@hnasr Got it, thanks.. I will check your stateless vs stateful video
@_SoundByte_
@_SoundByte_ 3 жыл бұрын
TCP headers are tracked (seq numbers, error correction etc). Http headers are not tracked by the server. Hence stateless.
@hnasr
@hnasr 3 жыл бұрын
Yup 👍👍
@markreyronolo1482
@markreyronolo1482 3 жыл бұрын
Hussein "Sent the dang packet" Nasser
@rahuldeep4811
@rahuldeep4811 3 жыл бұрын
Hi @Naseer, How UDP server sends response back to Client? For example like in multpi player game, how Gaming server inform end game user that the building is destroyed?
@hnasr
@hnasr 3 жыл бұрын
The udp packet has a source ip address the server can use to send replies back
@asimarunava
@asimarunava 3 жыл бұрын
@@hnasr it means the client will act as a server when recieving data. So client must run a udp server? Am i making sense with my question?
@justsaysharu
@justsaysharu 3 жыл бұрын
So is QUIC just the best of both the worlds? I mean a combination of TCP and UDP features - by processing the ACKs of each channel/StreamID individually? But still, need an ACK for guarantees?
@hnasr
@hnasr 3 жыл бұрын
I wouldn’t go as far as say that QUIC is the best.. QUIC was designed to solve the limitation where a client need to send multiple requests to the same host in parallel specifically stateless requests.. web browsing is great for that.. does it fit all cases ? Maybe yes maybe no.. QUIC comes with cost that people are still try to minimize.. nothing beats raw TCP/UDP so far as we know
@LordNementon
@LordNementon 3 жыл бұрын
@@hnasr SCTP ? 🙃
@waynewatson7970
@waynewatson7970 3 жыл бұрын
Hi Hussein, newbie here, can you post a video on hosting a basic website, which hosting platform. I get confused by all the options and I am trying to learn web dev on a budget. For example say I progress from hello world page to a node.js/mongodb/postgres page/app, how do I host that, where do I host that. It is very confusing. I want to be able to at some point in the future have my own website with multiple links to different projects, some of which may use leaflet.js and postgres or mongodb. I also would like to make sure once I set up a login page that the node server is secure etc. Can you shed some light, I ask you because I have enjoyed your video's and they help me understand things better. I know I could walk through all your videos and piece it together, but I am hoping for at least a general idea on what is important and what is not. Maybe I just go to AWS or Azure, but the last time I was with AWS and posted a simple website I was unsure of possibly getting charges I didn't understand. Thank you.
@hnasr
@hnasr 3 жыл бұрын
Hey Wayne I love to start from scratch and host the website on my own laptop so that people understand how things work before jumping to the cloud.. You are right there are so many options out there so if you self host on your own machine you know exactly what you need to do the work See my caddy web server video its the easiest kzbin.info/www/bejne/qmXRkn98iNF1prM
@waynewatson7970
@waynewatson7970 3 жыл бұрын
@@hnasr thank you sir, will look at video and see where I am at. :)
@medilyesoudhini7411
@medilyesoudhini7411 3 жыл бұрын
14:50 low latency* not high latency
@mmu200
@mmu200 3 жыл бұрын
Hahaha, Like your blaaaaaaa for describing UDP.
@rezmed1144
@rezmed1144 2 жыл бұрын
Amazing you're an arabic version of Lunduke
@_SoundByte_
@_SoundByte_ 3 жыл бұрын
Nice haircut :P less distraction
@hnasr
@hnasr 3 жыл бұрын
For me too haha
@user-oy4kf5wr8l
@user-oy4kf5wr8l 3 жыл бұрын
Tcp is like the first 3 years of ur marriage, u talk, ur wife listens. UDP is tge marriage after hahaha. U two just don't care whether the other one listens to u or not hhh.
@hnasr
@hnasr 3 жыл бұрын
采花大盗江南 😂😂
@user-si5vk5cd9w
@user-si5vk5cd9w 3 жыл бұрын
why vpn apps use UDP ?
@hnasr
@hnasr 3 жыл бұрын
Because otherwise the VPN will suffer from TCP meltdown.
@tambolaking5383
@tambolaking5383 3 жыл бұрын
TCP makes sure your receive UDP just sends TCP is a good salesman. Follows up. UDP is an unmotivated employee. Ask it to send, it sends, nothing more, nothing less.
@hnasr
@hnasr 3 жыл бұрын
I am UDP always
@eccosabanovic1589
@eccosabanovic1589 3 жыл бұрын
...so UDP is Alpha and TCP is simp..lol
Is there a Limit to Number of Connections a Backend can handle?
18:43
Hussein Nasser
Рет қаралды 32 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 46 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 26 МЛН
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 42 МЛН
TCP vs UDP - Explaining Facts and Debunking Myths - TCP Masterclass
20:24
Practical Networking
Рет қаралды 86 М.
What happens before the Backend gets the Request
51:26
Hussein Nasser
Рет қаралды 47 М.
Everything You Need to Know About QUIC and HTTP3
29:20
NGINX
Рет қаралды 15 М.
What is a Protocol? (Deepdive)
18:14
LiveOverflow
Рет қаралды 160 М.
UDP doesn't suck! It's the BEST L4 protocol for THESE types of applications...
11:52
The QUIC Protocol, HTTP3, and How HTTP Has Evolved
17:32
TheDataDaddi
Рет қаралды 39 М.
Web Server Concepts and Examples
19:40
WebConcepts
Рет қаралды 233 М.
TCP vs. UDP in 12 minutes | Systems Design Interview 0 to 1 With Ex-Google SWE
11:42
TCP vs UDP Comparison | Cisco CCNA 200-301
7:13
CertBros
Рет қаралды 296 М.
Как слушать музыку с помощью чека?
0:36
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 1,9 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 3,1 МЛН
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 2,2 МЛН
Я УКРАЛ ТЕЛЕФОН В МИЛАНЕ
9:18
Игорь Линк
Рет қаралды 97 М.