
Inside Guardian V2: Decoupling a Monolithic Rules Engine into a Modern Platform Powered by StarRocks, FlinkSQL, and Iceberg
Pinterest completely modernized Guardian, its real-time analytics and rules engine for Trust & Safety, into a modular V2 architecture. By separating query discovery, streaming processing, and historical replay into dedicated paths, Guardian V2 eliminated historical scaling bottlenecks while preserving an agile investigation-to-action workflow. This evolution provides a comprehensive blueprint for engineering teams building large-scale data and abuse mitigation platforms.
Highly recommended for data infrastructure engineers, backend architects, and Trust & Safety tech leads who design real-time event processing platforms or migrate monolithic data pipelines to modern streaming engines.
Pinterest's legacy Guardian V1 platform used a monolithic architecture to handle interactive querying, continuous stream evaluation, and backfill workflows, which led to severe scalability bottlenecks, reduced reliability, compliance risks, and high operational maintenance costs as traffic expanded.
The team rebuilt the platform into Guardian V2 by decoupling real-time analytics, continuous signal generation, action evaluation, and historical replay into specialized paths. Key architectural decisions included maintaining a unified GSQL V2 translation layer, implementing stream splitting and pruning, adopting StarRocks for analytics, and leveraging FlinkSQL and Iceberg for stream processing and replay.
The new architecture reduced the indexed column scale from O(20K) to O(K), enabled sub-second query latencies for high-selectivity analytics, and significantly improved system reliability, scalability, data governance, and maintainability while retaining the fast loop from investigation to enforcement.
Trade-off
Shifting from a monolithic system to a decoupled architecture with StarRocks, FlinkSQL, and Iceberg increased overall architectural complexity and reliance on specialized central data platform components.
A data plane technique that divides broad, highly sparse event streams into smaller, correlated event family streams while removing unneeded fields before ingestion.
A modern distributed SQL query engine optimized for vectorized execution, columnar storage, and real-time analytical workloads over high-volume data streams.
An architecture combining continuous stream processing via FlinkSQL with open table format storage via Iceberg to unify live action evaluation and historical replay.




