REST API (HTTP) vs Websockets - Concept Overview With Example

preview_player
Показать описание
Learn the differnce between a REST API and Websockets in this practical example.

In this video, we use a realtime chatting application as a toy example to understand the difference between REST APIs and Websockets. We examine the problem through the lens of both technologies and show how the approach will be different using one over the other.

Become a Better Developer Using the Courses I Recommend Below:

🎉SUPPORT BE A BETTER DEV🎉

📚 MY RECOMMENDED READING LIST FOR SOFTWARE DEVELOPERS📚

🎙 MY RECORDING EQUIPMENT 🎙

💻 MY DESKTOP EQUIPMENT 💻

🌎 Find me here:

#REST
#Websockets
#API
Рекомендации по теме
Комментарии
Автор

Looking to create a REST API or setup Websockets using AWS? Check out these step by step walkthrough videos below:

BeABetterDev
Автор

Lets hope someday majority of tech presenters on youtube would know how to a make a to-the-point great video - like this one. No bs, no mumbo jumbo, no need to market the channel or request for subscription etc.; just focusing on bringing the concepts home. Great job, man.

jadeedstoresupport
Автор

The client still has to play *ping-pong* with the server to keep the connection alive, but it's safe to say, that a lot of overhead - especially the HTTP-Header - are cut out by websockets and it's my go to for web applications. In my view the REST model is still important, especially for static sites and APIs, which don't depend on near real time communication.
Overall, you've done a pretty good video, it's a great explanation for newbies ^_^

freshlix
Автор

This is a cool explaining video about the usage of each...
In real life you usually use both in the same application. In my case, I had to build a REST service API with some endpoints, but there is a particular Endpoint that creates a user instance for remote execution, so N users in a project can start an engine in their PC and making a GET call to the endpoint 'url/tasks/SRS' will see how many remote execution nodes are available for the project, make a direct connection between the client and a user engine with websockets and start making a remote execution and see the stdout in real time...

This is very useful when having a very heavy software that requires multiple instances to run modules or subprocesses of the main one :D!

Zoditu
Автор

Recently I had to rewrite backend of my online game from REST API to a websocket. The problem is this game was my college project and something completely amateur. But I thought I could make things more efficent by fixing the backend. By switching to websocket from rest api, average ping dropped to 30 from 100, which seemed fine. But still I had the client side playing ping-pong thing with the server, which reduces the performance of the server extremely high with each player being online. After learning more about websockets, I realised that I have to change whole logic of my communication structcure. I just removed the old system completely and switched to the websocket, I hope I will be able to implement a new structcure that is efficent for the use of the websocket. Thanks for the video and all the information.

MertOguz
Автор

It is good to note that the web sockets opens the connection across all the network components between the device and server. Components such as NAT will prevent the server from sending a message directly to the device without the web socket.

JonathanNelson-nelsonj
Автор

Clean and simple explanation, nice job!

farzadb
Автор

Good video explaining the differences and going into detail with long vs short polling. However, for this setup I would say even sockets is a bit of an outdated way of doing things. WebRTC would be the prefered method where messages are peer to peer which would only require a server for the initial peer to peer connection setup and then all messages bypass the server. Obviously depends on use case - do you need to store messages in a DB for later etc. but for a simple chat system that doesn't need stored history I would say webRTC would be the way to do this.

AlexBoltonKing
Автор

Very clear and simple description. Thank you very much

khaledqa
Автор

Love your straight forward presentation man!

learnandexplorewithsab
Автор

Thank you so much for comming up with an excellent explaination of complex mechanisms.

farazahmed
Автор

Thank you for the excellent and concise presentation of these two techniques! 👍

srb
Автор

Thank you. A very clear and to the point presentation.

pixelettee
Автор

Man I love your videos. Please do a vid on automation using AWS if you ever find the time

doctorpanga
Автор

I use dyndns and want to use websockets on a small esp32 at home. I can connect from anywhere remote but not with websockets. Any help would be so appreciated.

drakkorvladimir
Автор

Brilliantly explained! Need more such top level videos to deconstruct software.

shantanu
Автор

Awesome. Your way to learn it's very clear! Thanks to share this content.

gui_dev_
Автор

Very clear explanation, thanks for posting it !

stephaneiung
Автор

not saying this comment applies to this video, but miss the dislike metric. it gives a clear indication of how useful a technical video is going to be

nathanwilcox
Автор

Last time I looked at this, most websockets communication with end users had to use long polling under the hood. Did this change ye

EdFrench_uk