Discord has open-sourced Osprey, an internal safety rules engine capable of evaluating 2.3 million rules per second across 400 million daily actions. The system uses a polyglot architecture: a Rust coordinator handles high-concurrency traffic and gRPC routing, while stateless Python worker nodes execute rules written in SML, a Python-based domain-specific language. Rules are parsed into an AST at startup to minimize per-event overhead and distributed via ETCD for live updates without redeployment. Output sinks are pluggable via the Pluggy library, with a reference deployment using Apache Kafka and Apache Druid. The project is managed under the ROOST organization and has seen early adoption by Bluesky and Matrix.org.

3m read timeFrom infoq.com
Post cover image

Sort: