Webhooks by dokuDoku system design 🔍 ## What are Webhooks? Webhooks are a type of event driven API. Rather than sending information in response to another application's request, a webhook sends information or performs specific functions in response to a trigger. The key point here is that the *application sending the data initiates the transfer*. This is often referred to as a *reverse API*, since the server calls the client, not vice versa. This is great because it eliminates the need for clients to poll the server to ask for updates, especially when updates are sparse and at non-predictable intervals. The server chooses when to send clients updates since the server knows when it has updates to send. Typically, Webhooks are for spontaneous, short updates not live updates or sending many updates to a client in a row. For this please read about Server Sent Events, WebSockets, WebRTC, etc. The prime use case is for spontaneous notifications where you do not want your client to have to poll. Polling wastes both client and server resources and makes applications difficult to scale. TLDR Webhooks: - Eliminate need for polling - Quick to set up - Automate data transfer - Good for lightweight, specific payloads ## How does a Webhook work? Webhooks are client defined callbacks made with a HTTP Post request. The client specifies a URL where the server will post to and for what events. Typically, there is authentication in the header. The server then pushes out data to target URLs which are typically client webscripts or handlers. Clients are then free to process this data locally. Hence clients no longer need to poll servers because servers send information to clients when new data comes in. ## Who uses Webhooks? Anyone who needs to send notifications typically uses webhooks. Applications include mobile messaging, package delivery, email, etc. This is a wide spread innovation that frees clients from continually polling servers enabling easier scaling and faster updates. Read the following to learn more about webhooks: [Red Hat: What is a webhook?](https://www.redhat.com/en/topics/automation/what-is-a-webhook) [Web hooks to revolutionize the web (2007)](https://progrium.github.io/blog/2007/05/03/web-hooks-to-revolutionize-the-web/) [Webhook vs. API](https://zapier.com/blog/webhook-vs-api/) ## What are Webhooks? Webhooks are a type of event driven API. Rather than sending information in response to another application's request, a webhook sends information or performs specific functions in response to a trigger. The key point here is that the *application sending the data initiates the transfer*. This is often referred to as a *reverse API*, since the server calls the client, not vice versa. This is great because it eliminates the need for clients to poll the server to ask for updates, especially when updates are sparse and at non-predictable intervals. The server chooses when to send clients updates since the server knows when it has updates to send. Typically, Webhooks are for spontaneous, short updates not live updates or sending many updates to a client in a row. For this please read about Server Sent Events, WebSockets, WebRTC, etc. The prime use case is for spontaneous notifications where you do not want your client to have to poll. Polling wastes both client and server resources and makes applications difficult to scale. TLDR Webhooks: - Eliminate need for polling - Quick to set up - Automate data transfer - Good for lightweight, specific payloads ## How does a Webhook work? Webhooks are client defined callbacks made with a HTTP Post request. The client specifies a URL where the server will post to and for what events. Typically, there is authentication in the header. The server then pushes out data to target URLs which are typically client webscripts or handlers. Clients are then free to process this data locally. Hence clients no longer need to poll servers because servers send information to clients when new data comes in. ## Who uses Webhooks? Anyone who needs to send notifications typically uses webhooks. Applications include mobile messaging, package delivery, email, etc. This is a wide spread innovation that frees clients from continually polling servers enabling easier scaling and faster updates. Read the following to learn more about webhooks: [Red Hat: What is a webhook?](https://www.redhat.com/en/topics/automation/what-is-a-webhook) [Web hooks to revolutionize the web (2007)](https://progrium.github.io/blog/2007/05/03/web-hooks-to-revolutionize-the-web/) [Webhook vs. API](https://zapier.com/blog/webhook-vs-api/) Comments (0) Please log in to comment. No comments yet. Be the first to comment! ← Back to Blog
Comments (0)
Please log in to comment.
No comments yet. Be the first to comment!