Card 10/ 10

RecapDifficulty: Intermediate1 min

Recap: Client-Server Communication Patterns

Five patterns by who starts and what stays open, and the rule for choosing.

  • The patterns differ in who starts and whether a connection stays open (Five Ways for New Data to Reach a Client).
  • Short polling asks on a timer; news is as late as the interval (Short Polling: Asking Again on a Timer).
  • Long polling holds each request until there is news, then the client asks again (Long Polling: Holding the Request Until There Is News).
  • Server-sent events stream one way down one open response, and the browser resumes by itself (Server-Sent Events: A One-Way Stream to the Browser).
  • WebSockets carry messages both ways over one open connection (WebSockets: A Two-Way Connection That Stays Open).
  • Webhooks are another server calling yours; verify, record, answer at once (Webhooks: Another Server Calls Yours).
  • Choose by who is on the other end, who sends, and how soon (Choosing How Updates Reach the Other Side).
  • Deduplicate and reconcile, because senders differ on retries (Webhooks Missed While Your Endpoint Is Down).