Case Study
Twitch Go Chat Backend
Illustrative reference design for the Go, Redis, kafka stack: component roles, highlights and trade-offs. No production metrics claimed.
Illustrative walkthrough. This page is a reference design built around the stack listed above. It is not an audit of the named project’s production system, and it makes no measured performance claims. The referenced repository (https://github.com/twitchtv/twirp) is the source of truth for the real implementation.
Component roles
- Go — Primary service implementation; keep request paths explicit and avoid hidden goroutine lifetimes.
- Redis — Low-latency cache and coordination; TTL and eviction policy are explicit.
- kafka — Durable event log; consumer lag is the health signal that pages someone.
- WebSocket — Supporting component; write down its contract with the rest of the system before wiring it in.
Design highlights
- Million concurrent connections
- Pub/sub channel routing
- Backpressure handling
Trade-offs to check before adopting
- Asynchronous pipelines decouple producers from consumers but make end-to-end failure handling harder to reason about.
- Caching buys latency and adds an invalidation contract that must be maintained.
Where to look next
- Repository: https://github.com/twitchtv/twirp
- The related runnable examples below show the individual pieces this walkthrough composes.
Repository
View on GitHub ↗Report a problem with this caseOpens a pre-filled issue on GitHub.