Sixty Requests One Channel
Discord puts a Rust "data services" layer between the API and the message store. When several callers ask for the same data at once, the first request spins up a worker task and later requests subscribe to that same task instead of issuing their own query. This is request coalescing.
A popular channel is linked in an announcement. In a single millisecond, 60 requests for that channel's recent history arrive at the data services tier. The tier runs 12 instances and the API load balancer sends requests to them round robin.
How many queries reach the database?
Sign in to answer questions and track your progress
Sign In