Introduction
In the world of web development, there are numerous technologies and terminologies that developers come across, two of whic...
For further actions, you may consider blocking this person and/or reporting abuse
I love your article especially the "Use cases" section. But I think it's worth reminding the reader that you could in theory substitute a Webhook impl with WebSocket. The converse however won't work. The catch is that WebSocket requires you to maintain a TCP connection and that is a waste of resources vis-a-vis the Webhook use cases.
Thank you a lot Bremer, I'm glad you liked it!
Yes, that's true, it depends on each use case. WebSocket is more complex solution, and you need to maintain a stable connection by a TCP protocol. If is just needed some kind of "event listener" to get real time updates for example instead of polling an API (and get rate limited) webhook is definitely the best solution.
I've seen webhook endpoints in several applications but never really read about it.
I loved the use cases along with the clear explanation and of course the
shout-out
system. πthanks Anmol, yes I have noticed that there is indeed some confusion when it comes to these two technologies. They are often confused.
So, would you consider websockets for any implementation that requires two-way client-server communication? For example, in polling scenarios? I assume that webhooks can't be applied to a client-side environment, right?
Great article, by the way.
Hey Lucas, thanks for liking the article, I'm glad you liked it!
Yes, youβre spot on. WebSockets are great for two-way chats between a client and server, like in polling scenarios. And if for example, the server needs to push updates to the client in real-time, which is not possible with traditional HTTP requests.
Webhooks, on the other hand, are more for server-to-server communication. For example, if one server needs to notify another when a specific event has occurred, but yes, theyβre not designed for client-side environments.
Great.. Article.. Loved itπ«΄β€οΈ
Thank you Shyam, glad you liked it! π
Awsome article @ricardogesteves, super useful. π€©
Thanks Diogo, glad you liked it! π
Hi Ricardo.
Nice readable informative article.
What do you think of "long-polling" - would you say that can be used rather than webhooks if you have a very small requirement.
Have you ever used it?
Hello Fakie, Iβm glad you found the article informative.
Long-polling can indeed be used as an alternative to webhooks for smaller requirements. Itβs simpler and doesnβt require the setup of a callback endpoint as webhooks do. The main issue for me is that long-polling can be more resource-intensive on the server side because connections are kept open longer.
But if it is a service that you have available for free, sure it could be a simpler solution.