Cloudflare analyzes over 1 million DNS queries per second using a ClickHouse database. Logs from Cloudflare's edge servers are sent to Kafka topics and then aggregated into low-cardinality datasets using Spark Streaming before being inserted into ClickHouse. ClickHouse allows for complex ad-hoc queries on trillions of rows of DNS log data in near real-time and stores aggregations for long-term analysis. Contributions to ClickHouse help optimize it for Cloudflare's scale and analysis needs.