Ever wonder how the Google Ads team keeps the massive system stable and online, despite continuous attempts by hackers to take it down? Part of the answer is using Spanner as its core operational and graph database.
The Google Ads team uses a central graph-based platform to fight fraud and abuse with batch and real-time signals. Built to protect the Google Ads ecosystem and now used by multiple teams across Google, the platform organizes anti-abuse intelligence into a single, interconnected view. Its core mission is simple but critical: uncover hidden connections between malicious assets in real time before they can harm users or advertisers. This blog talks about the challenging modern fraud and abuse landscape, and how Spanner, specifically Spanner Graph, helps Google successfully detect those threats.
The rising cost and sophistication of modern fraud
The need for a graph-based abuse detection platform stems from how the global threat landscape has evolved. Digital advertising fraud and online scams are no longer minor operational nuisances, they are a massive drain on the global economy. According to the NASDAQ Global Financial Crime Report, total global fraud losses are estimated at nearly $580 billion for 2025. Furthermore, global surveys indicate that approximately one in five adults fall victim to scams. In digital ads, fraud and abuse waste marketing spend, corrupt attribution data, and expose everyday users to financial scams, identity theft, and malware.
Bad actors are increasingly leveraging automation and AI to scale deceptive campaigns more efficiently. In 2025 alone, Google blocked or removed more than 8.3 billion policy-violating ads and suspended 24.9 million advertiser accounts. As these tactics evolve, real-time detection becomes more important for protecting businesses and users.
Why stopping modern abuse is so complex
Defending applications from fraud and abuse requires continuously advancing threat detection beyond traditional, point-in-time checks. To do that, modern security systems must address two compounding challenges simultaneously:
-
Fraud and abuse operate as networks: Bad actors hide behind residential proxies and synthetic identities to create deceptive ad campaigns. Each of the attributes like location proxies, account, and identity parameters appear benign in isolation. But behind the scenes, bad actors share payment methods, domains, and accounts, requiring security systems to target entire coordinated clusters of fraud rather than isolated indicators. This is hard to capture with traditional approaches that do not understand the relationship between attributes and evaluates each signal separately.
-
Detection must scale dynamically: As the graph-based abuse detection platform grew, the previous system, based on offline MapReduce batch processing, became bottlenecked. Tracing multi-hop relationships in batch MapReduce required repeated, expensive joins across distributed stages, triggering massive intermediate data expansions, heavy shuffle overhead, and network bottlenecks that caused hours-long latencies and combinatorial fanouts during multi-hop traversals.
In critical scenarios like halting live malware campaigns, multi-hour latency gaps leave room for a lot of damage. To block sophisticated fraud rings, Google needed to evaluate multi-hop relationship risks in real time at the time of serving these ads, before malicious content reaches users.
Why Spanner Graph
To overcome the limits of processing at inference time, the engineering team needed a database that could ingest live signals from a large number of sources via pub/sub streams, all while delivering horizontal elasticity, global transactional consistency, and sub-second multi-hop traversals. The solution was to modernize Google’s graph-based abuse detection platform for Ads onto Spanner Graph.
Because Ads’ core transactional and entity data already lived in Spanner, they didn’t need to migrate any data in order to adopt Spanner Graph. Rather than standing up a separate, specialized graph database, the team simply defined property graphs directly on top of their existing relational tables.
This delivered several benefits:
-
From hour-long batch jobs to sub-second queries: Spanner Graph co-locates graph traversal computations directly with the underlying distributed data splits to minimize join overhead. Multi-hop traversals that previously took an hour in offline Apache Flume MapReduce jobs now execute on live production data with sub-second to single-digit millisecond latency.
-
Zero-ETL adoption in weeks, not months: Because there was no data to move, most graph-based abuse detection use cases transitioned to Spanner Graph within weeks. Layering a graph directly onto existing Spanner tables eliminated fragile synchronization pipelines and redundant storage costs.
-
Expressive pattern matching with native ISO GQL: Instead of writing and maintaining complex custom traversal code, engineers now query the exact same tables using standard ISO Graph Query Language (GQL), significantly accelerating feature velocity.
Source Credit: https://cloud.google.com/blog/products/databases/how-spanner-graph-detects-google-ads-fraud-and-abuse/
