A WebHook registers or “hooks” to a Callback URL and will notify you anytime an event has occurred.
A WebSocket provides a long-lived connection for exchanging messages between client and server. The connection is full-duplex, meaning data can be sent and received in realtime from both ends.
HTTP Long-Polling provides a long-lived connection for instant data push. The server holds the request open until new data or a timeout occurs. Most send a timeout after 30 to 120 seconds, it depends on how it was setup. After the clients receives a response (whether that be from new data or a timeout), the client immediately sends another request and this is repeated continuously.
HTTP Streaming provides a long-lived connection for continuous data push. The client sends a request to the server and the server holds the response open for an indefinite length. This connection will stay open until a client closes it or a server side-side event occurs.
An application programming interface (API) is a set subroutine definitions, protocols, and tools for building software applications. In other words, APIs act as the middleman that help software applications connect to each other and exchange information.
Realtime refers to a synchronous, bi-directional communication channel between endpoints at a speed of less than 100ms.
We’ll break that down in plain[er] english:
- Synchronous means that both endpoints have access to data at the same time (not to be confused with sync/async programming).
- Bi-directional means that endpoints can send data in either direction.
- Endpoints are senders or receivers of data: they could be anything from an API endpoint that makes data available to a user chatting on their phone.
- 100ms is somewhat arbitrary: data cannot be delivered instantly – but under 100ms is pretty close, especially with respect to human perception. Robert Miller proved this in 1986.