0

I do not understand the real difference between webhooks and traditional pooling of endpoints because to me webhooks still require pooling.

**Traditional case: Client asks, server tells ** In a package delivery application, the authenticated user calls server endpoints to check the status of the package delivery, this happens at specific frequency.

** Webhooks case: Server tells, client does ** In a package delivery application:

  • the server implements event driven pattern, notifying another endpoint (webhook) about it's changes, let's say it pushes the data to endpoint https://webhook.delivery.app/hook01
  • the server hosting the endpoint https://webhook.delivery.app/hook01/ receives the data and applies some business logic on it.
  • the client application - Here is the problem, how does the application know that the webhook has received data following an event ? Normally, it should start pooling some other endpoints to get that data. I do understand there is a workload offloaded from the server to another server hosting the webhooks endpoints, but still there is pooling here happening on client side otherwise it would not know anything about the data.

Watched youtube videos Asked chatgpt

I expected clarity got complexity instead

1 Answer 1

1

A webhook is a way for your backend to get notify when an operation is completed. you provide the webhook API with a webhook URL , and then the API sends the data to that URL once the operation happend.

the frontend doesnt have direct way to receive these notifications, because webhooks are HTTP requests sent to a server endpoint. If you want the client to know about the change in real time without pooling your backend must forward the update using techniques like WebSockets, Server-Sent Events (SSE)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.