Menu
Pinterest Engineering·November 16, 2026

Pinterest's Guardian V2: Real-Time Abuse Platform Architecture for Scale and Reliability

This article details Pinterest's architectural overhaul of its real-time abuse detection platform, Guardian, from a monolithic V1 to a modular V2. The rebuild focused on achieving greater scalability, reliability, maintainability, and compliance by decoupling components and leveraging modern data infrastructure like StarRocks and FlinkSQL. Key system design decisions included stream splitting, specialized execution engines, and a unified query-to-action workflow.

Read original on Pinterest Engineering

Introduction to Guardian and its Challenges

Pinterest's Guardian platform is a critical system for real-time abuse detection, encompassing spam, fraud, account takeover, and unsafe content enforcement. It allows subject matter experts to analyze event streams, identify patterns, and operationalize findings into policies and workflows. While Guardian V1 excelled at enabling a fast feedback loop from investigation to action, its monolithic architecture faced significant challenges at Pinterest's scale, including issues with scalability, reliability, governance risks due to custom data infrastructure, and high maintenance costs. These limitations necessitated a complete rebuild.

V1 Monolithic Architecture Limitations

  • Scalability: A single monolithic core handled interactive querying, continuous event processing, and backfill workflows, making independent optimization difficult as traffic grew.
  • Reliability: Intermittent failures in indexing or slow queries impacted investigations and downstream processing.
  • Governance: Custom-built asynchronous database grew to hundreds of terabytes outside standard data governance, leading to compliance risks.
  • Maintenance Cost: Reliance on custom infrastructure prevented leveraging improvements in Pinterest's broader data stack, increasing engineering overhead.

Guardian V2: A Modular Platform

Guardian V2 transitions from a monolithic, in-house system to a modular platform built on Pinterest's modern data infrastructure. This architectural shift decouples real-time analytics, continuous signal generation, action evaluation, and historical replay into distinct paths, each optimized for its specific scaling and operational requirements. The core design principles were to preserve the speed of the original workflow while dramatically improving scalability, reliability, maintainability, and compliance.

Key Architectural Decisions in V2

  • Unified Workflow with GSQL V2: Maintained a consistent user experience despite backend decoupling. A thin Java-based translation layer (using ANTLR4) maps GSQL queries to StarRocks SQL for analytics and FlinkSQL for continuous processing.
  • Stream Splitting and Pruning: Introduced a data plane optimization where enriched events are split into smaller, more correlated event-family streams. This significantly reduces data sparsity for downstream systems, improving storage and processing efficiency for both analytics and action evaluation.
  • StarRocks for Real-time Analytics: Rebuilt the interactive query path using StarRocks, a distributed SQL engine. Optimized with duplicate key tables for write-heavy ingestion, carefully designed sort keys, partitioning, bucketing, and Bloom filter indexes for low-latency lookups.
  • FlinkSQL for Asynchronous Evaluation: Leveraged FlinkSQL for continuous signal generation and action evaluation, allowing for efficient processing of relevant event streams based on the stream splitting strategy.
💡

Learning Point: The Power of Data Plane Optimization

Pinterest's experience with Guardian V2 highlights that system scalability isn't just about faster backend engines. Reshaping the data plane through techniques like stream splitting and pruning can drastically reduce the complexity and volume of data processed by downstream systems, leading to more efficient resource utilization and easier scaling. This shifts complexity from application logic into shared infrastructure.

real-time processingabuse detectiondata pipelinestream processingStarRocksFlinkmonolith to microservicesscalability

Comments

Loading comments...