Great architectural read from the Pinterest Engineering team on how they rebuilt
Guardian, their real-time Trust & Safety platform, from a custom monolith into a modular, scalable data infrastructure.
Fighting spam, fraud, and account takeovers requires an ultra-fast loop from real-time investigation to automated enforcement. As Pinterest scaled, coupling interactive queries, streaming actions, and historical backfills in one monolithic core hit clear limits on scalability, reliability, and governance.
What stands out in
Guardian V2 isn’t just the modern tech stack—it’s how they decoupled the architecture
without breaking the user workflow:
🔹
Unified UX via GSQL V2: Analysts still write in a single SQL-like language, while a lightweight ANTLR4 translator routes ad-hoc queries to
StarRocks and continuous actions to
FlinkSQL.
🔹
Data Plane Pruning: Splitting wide, sparse event streams upfront shrank analytical column counts from $O(20\text{K})$ down to $O(\text{K})$, drastically cutting storage and compute overhead.
🔹
Sub-second Investigation: Leveraging
StarRocks (duplicate key tables + Bloom filter indexes) for real-time feature discovery.
🔹
First-class Replay: Running the exact same
FlinkSQL rules across live streams and 30-day
Apache Iceberg tables for seamless backfills.
A textbook example of separating compute, storage, and execution paths while keeping the developer and analyst experience unified. Worth a read for anyone building real-time analytics or risk platforms at scale! 👇
medium.com/pinterest-engineering/rebuilding-guardian-how-pinterest-upgraded-its-real-time-abuse-platform-to-modern-infrastructure…
#DataEngineering #RealTimeAnalytics #TrustAndSafety #StarRocks #ApacheFlink #ApacheIceberg #SystemArchitecture