Card 09/ 10
Practice: Picking a Pattern for Four Features
A job status page, a chat, a live score and a payment confirmation.
Choosing a communication pattern by who sends and how soon is practised here on four features from one product. Decide a pattern for each, with one sentence of reasoning, before opening the answers.
The brief. A sports club runs one web app.
- Members export their match history as a file, which takes a minute or two to build; the page shows when it is ready.
- Team members chat with each other during a match.
- Fans watch the live score of the current match update in the browser.
- Members pay their annual fee through a payment provider, and the club's system must mark them as paid.
Check your choices
- Short polling. A delay of a few seconds does not matter, and only a handful of members export at a time, so a request every five seconds is cheap.
- WebSockets. Both sides send often, and each message is small.
- Server-sent events. Only the server sends, news must arrive at once, and the browser reconnects and resumes by itself.
- A webhook. The payment provider has the news; it calls the club's endpoint, which verifies the signature, records the event id, and replies at once.
← → move through sections and cards