Webhooks vs Websockets vs HTTP Streaming - Which Event-Driven API to use?

Поделиться
HTML-код
  • Опубликовано: 3 июн 2024
  • As a backend engineer, it's crucial that you understand which event-driven API is best for your use case. This video goes through the 3 most commonly used API standards which are Webhooks, Websockets and HTTP Streaming.
    Timecodes
    0:00 - Intro
    0:38 - Recap on Request-Response APIs
    2:22 - Webhooks
    5:12 - Websockets
    7:51 - HTTP Streaming
    10:08 - Conclusion

Комментарии • 108

  • @ben.aka.bigben
    @ben.aka.bigben 9 часов назад

    Man, I just came across your channel and its very sad that you stopped for a year now. The way you explaining things is spot on.

  • @yosvelquintero
    @yosvelquintero 2 года назад +72

    WebHooks: Good for updating clients on certain events and avoiding pulling style endpoints
    WebSockets: Good for low latency two-way communications
    HTTP Streaming: Good for long-term connections over HTTP

    • @user-he8rl4sm3k
      @user-he8rl4sm3k 2 года назад

      I assume HTTP streaming would be optimal for updating notifications for a social app? Or would that be a WebHook?

    • @LucasSilva-mw7pk
      @LucasSilva-mw7pk 2 года назад

      @@user-he8rl4sm3k WebHook is more indicated if you need a bi-directional fast communication (eg: a shooter online game). In your case of social app, your cliente just need to receive new messages, so might be better if you use streaming.
      For things like chat messages, I would said that the better options should be use something like MQTT. You can also do it by using Long Pooling, but it can be quite inefficient

  • @dhanishthaghosh9548
    @dhanishthaghosh9548 2 года назад +80

    Good explanation! One request, please keep the background music on a lower note (/volume) since it is causing hindrance in concentration and hearing.

    • @ambientcoder5462
      @ambientcoder5462  2 года назад +15

      I’m glad you liked the explanation! Thanks for the feedback, it’s very valuable to me. I’ll definitely keep the background music in mind for future videos 👌

    • @subramanyamramasani1759
      @subramanyamramasani1759 2 года назад +1

      Hi bro can you help me how to create webhooks for springboot microservices

    • @robinmaurer2645
      @robinmaurer2645 2 года назад +1

      @@ambientcoder5462 the music genre is perfect and for any other video format than information/explanation /education the volume is too but here as the comment said just a smidge too loud. Have agreat day!

    • @user-he8rl4sm3k
      @user-he8rl4sm3k 2 года назад

      @@ambientcoder5462 I assume HHTP streaming would be optimal for updating notifications for a social app? Or would that be a WebHook?

  • @toekneema
    @toekneema 3 года назад +3

    truly an amazing video, especially since you also reviewed the Request/response at the beginning!

  • @daniel280187
    @daniel280187 3 года назад +6

    Great explanation. I appreciate the comparison of the 3 methods with visualizations. Thanks for sharing!

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      Thank you :) I’m glad you liked the visualizations.

  • @carltone
    @carltone 3 года назад +10

    Great comparison video. The connection graphics, pro/con format is well done. Thanks for sharing your knowledge.

  • @ammadkhan4687
    @ammadkhan4687 3 месяца назад

    Very helpful. Gold worth information at one place. Thanks for sharing.. really appreciate

  • @TaoLi302
    @TaoLi302 3 года назад +6

    Your channel deserve 400K subscribers. let's make it to 10K first. Really clear explanation to none engineer. Hope you make more videos.

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      Thanks for your kind words, really appreciate them 🙂

  • @alibaba888
    @alibaba888 2 года назад +1

    One of the best youtube channels explaining APIs

    • @ambientcoder5462
      @ambientcoder5462  2 года назад

      Thanks for the kind words! Hope you’re enjoying the content 🙂

  • @johnswanson217
    @johnswanson217 2 года назад +3

    Very clean and clear one! Thank you!!

  • @isurujn
    @isurujn 2 года назад +1

    Nice video. Informative and to the point without any fluff 👍🏼

  • @javi_v7.0
    @javi_v7.0 Год назад

    Great video, brief, to the point.. Thanks!

  • @user-zb5jp4ti1d
    @user-zb5jp4ti1d 2 года назад +2

    This is so helpful. Thank you so much. It would be great if you could also provide the source of this information, books or articles that you referred to in order to put this together.

  • @johnnychang3456
    @johnnychang3456 3 года назад +1

    Clear and concise explanation. Thank you!

  • @wagnermoreira786
    @wagnermoreira786 2 года назад +1

    great explanation! I haven't seen the webhooks implementation on the client-side yet, now I need to try!

  • @SaintSaint
    @SaintSaint Год назад

    This was perfect. Thank you so much.

  • @muathithanhcong
    @muathithanhcong 2 года назад +2

    Great explanation! Thanks for sharing!

  • @sureshsambana5219
    @sureshsambana5219 3 года назад +3

    Thank you very much. That is a neat and smooth explanation. It helped me.

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      Happy to hear it helped you Suresh! And thanks for your kind words 🙂

  • @mrsbootsworkouts
    @mrsbootsworkouts 6 месяцев назад

    Very useful, thank you!

  • @idc19
    @idc19 Год назад

    Great content. Very enlighting.

  • @faketrump3605
    @faketrump3605 2 года назад

    you're very good at explaining the concepts. thanks.

  • @MrJonnis13
    @MrJonnis13 2 года назад +2

    Thank you. Very informative.
    Subscribed!

  • @prabhakarreddyg
    @prabhakarreddyg 3 года назад +2

    Thanks for crystal clear explanation

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      I’m glad you liked the explanation. Thanks for your support 🙂

  • @louicoder
    @louicoder 2 года назад +5

    You are such a great teacher, I like the simplicity in the explanation 🎉 🎉 🎉 🎉 🎉 🎉 🎉

    • @ambientcoder5462
      @ambientcoder5462  2 года назад

      Thanks a lot! I’m glad you liked my explanations 🙂

  • @Kathiisu
    @Kathiisu 2 года назад +2

    Thanks for the informative video! It is a great help in my process of creating an application.

  • @datapro007
    @datapro007 Год назад

    Good overview, thanks

  • @aryanrahman3212
    @aryanrahman3212 Год назад

    Just what I needed 😃

  • @BradleyADavis
    @BradleyADavis 3 года назад +2

    Great video, thanks!

  • @allezvenga7617
    @allezvenga7617 Год назад

    Thanks for your sharing

  • @pratheejgc2250
    @pratheejgc2250 2 года назад +2

    Perfect!!!

  • @JemilOyebisiDeveloper
    @JemilOyebisiDeveloper 3 года назад +1

    Great explanation!

  • @yogeshyadav5778
    @yogeshyadav5778 Год назад

    Excellent !!!

  • @rhtservicestech
    @rhtservicestech Год назад

    This is useful information

  • @chiragarora3985
    @chiragarora3985 3 года назад +2

    Amazing explanation 👍

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      I’m glad you liked it! Thanks for your kind words :)

  • @C0sm1c_Owl
    @C0sm1c_Owl 2 года назад +2

    Thanks!

  • @srinivasasowmiyan2272
    @srinivasasowmiyan2272 Год назад

    Thank a lot man❤Happy that I found your channel

  • @thatgenzdev
    @thatgenzdev 3 года назад +1

    Great explanation.

  • @lagua000
    @lagua000 3 года назад +2

    Great video!

  • @baghdadiabdellatif1581
    @baghdadiabdellatif1581 5 месяцев назад

    Thank you

  • @Prostopravda
    @Prostopravda Год назад +1

    Keeping a long-living connection is another issue with WebSocket if you use a cloud platform like Cloudflare for DDoS protection. Long-living connections cause Cloudflare servers to run out of ports, so the company has to take fee for that.

  • @victorpinasarnault9135
    @victorpinasarnault9135 2 года назад +2

    Real good
    Thank you

  • @mornemarais4198
    @mornemarais4198 Год назад

    well done thanks! :)

  • @ashutoshpathak1387
    @ashutoshpathak1387 Год назад

    Thanks.

  • @pagarevijayy
    @pagarevijayy 3 года назад +2

    nice man!

  • @AtifShafiinheritance
    @AtifShafiinheritance 2 года назад +2

    Great

  • @sangamsahai9823
    @sangamsahai9823 Год назад

    greatttttt video

  • @molletik
    @molletik 2 года назад +3

    Hi, it is a very good presentation. It is very helpful. If my application is very complex where it need to handle "Request-Response" and "Event-driven" API, how to define and aggregate both this API's?

    • @ambientcoder5462
      @ambientcoder5462  2 года назад +1

      Your API will contain multiple endpoints. So each endpoint can be a different style of endpoint depending on your use case.
      For example, retrieving a list of videos on a server is a request-response style endpoint. However, to stream an individual video would not necessarily be request-response style endpoint.
      It is important that you document these traits to the end user.
      Hope this helps 🙂

  • @foobar7889
    @foobar7889 3 года назад +4

    Is a con of the websocket approach that if there isn't that much traffic, it's a wasted thread keeping the connection open?

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      Yup you’re right. If there isn’t much traffic, websockets might be overkill. If you’d still like to keep things event driven, then webhooks might be an option worth considering.

  • @shubhankar915
    @shubhankar915 Год назад

    In webhooks, the client is actually another api server, which exposes an end point rather than a mobile or web client, is that correct?

  • @enfieldli9296
    @enfieldli9296 2 года назад +1

    Hi, which technique were used in push notification, like when someone replied our comment, and we get a notified in the inbox area with the amount of replies we are getting? like the bell icon in youtube

  • @AlexJaeger716
    @AlexJaeger716 Год назад

    Can i send an http post request while streaming over http?

  • @michaelamir6504
    @michaelamir6504 2 года назад +1

    What about the GraphQL subscriptions? 🤔

  • @rohitiyer230
    @rohitiyer230 2 года назад +3

    Does MPEG DASH use http streaming under the hood or websockets for streaming videos?

    • @ambientcoder5462
      @ambientcoder5462  2 года назад +1

      Most, if not all, video streaming platforms use HTTP streaming as far as I know. Hope this helps!

  • @jan5310
    @jan5310 Год назад

    Where does pub-sub with for example MQTT fall under?

  • @JNET_Reloaded
    @JNET_Reloaded 2 года назад +1

    Can you show how to make a secure node js running from php cli that uses cert an key pem files that allow voice streaming 2 way like a phone call app?

    • @ambientcoder5462
      @ambientcoder5462  2 года назад

      Thanks for the suggestion, I’ll consider it 🙂

  • @shadestorm3995
    @shadestorm3995 2 года назад +3

    i still don't follow webhooks but other two were crystal clear

    • @ambientcoder5462
      @ambientcoder5462  2 года назад

      Thanks 🙂

    • @jan5310
      @jan5310 Год назад

      you as client need to provide an public endpoint which the server can call when a certain (by the user/client) specfied event occurs.

  • @masudofficial76news12
    @masudofficial76news12 2 года назад +1

    🏆🇮🇩

  • @stevenlemmo4496
    @stevenlemmo4496 3 года назад +3

    You need to put your contact info in the RUclips about section.

    • @ambientcoder5462
      @ambientcoder5462  3 года назад

      Thanks for pointing this out Steven. I've updated the about section with my channel contact :)

  • @gauravpurohit3755
    @gauravpurohit3755 3 года назад +2

    anyone here..
    my question is can we use any of these connection type to any Api or it depends on Api.

    • @ambientcoder5462
      @ambientcoder5462  2 года назад

      Hey Gaurav, basically it depends on the API. For example, websockets require both the client and server to establish a websockets connection.
      Hope this helps! 🙂

  • @dopamine_Seeker
    @dopamine_Seeker 2 года назад +2

    Website socket is best

  • @sandeshth466
    @sandeshth466 Месяц назад

    Why not SSE

  • @sravanisajjan5735
    @sravanisajjan5735 2 года назад +9

    The music in the background is really disturbing and distracting

    • @ambientcoder5462
      @ambientcoder5462  2 года назад +3

      Thanks for the feedback. I'll keep that in mind for future videos

  • @DdPk3d
    @DdPk3d 11 месяцев назад

    great video but music is distracting

  • @einsof1232
    @einsof1232 Год назад

    put speed 1.5.. you welcome 😉

  • @joshr.2600
    @joshr.2600 6 месяцев назад

    🎶 music is weird.

  • @kamertonaudiophileplayer847
    @kamertonaudiophileplayer847 2 года назад +1

    No, no, again you explain not right. You do not explain why it is inefficient. Oh boy, misinforming people is really bad.

    • @ambientcoder5462
      @ambientcoder5462  2 года назад +1

      I've cleared explained why it's inefficient. Of course I have not gone into deep details but I've covered as much as I can in a short video. How exactly am I misinforming people?

    • @kamertonaudiophileplayer847
      @kamertonaudiophileplayer847 2 года назад

      @@ambientcoder5462 A frequent request isn't a cause of the slowness. I appreciate your attempt to educate people, but before doing that, you need have a clear understanding for yourself.

  • @rishikeshpawar3230
    @rishikeshpawar3230 Год назад

    Just remove that background music.... Its annoying

  • @DUhWcpgD7b4SDA2Aep9EqWLyfGu2
    @DUhWcpgD7b4SDA2Aep9EqWLyfGu2 2 месяца назад

    Thanks!