← Technology, Science & Infrastructure ▣ Distilled locally

How Spanner Graph detects ads fraud and abuse at Google at multi-billion node scale

By Deepak Tiwari
November 20, 2026  ·  Google Cloud Blog ↗

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:

  1. 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.

  2. 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:

image1

How a graph-based abuse detection platform detects fraud

With Spanner Graph, Google's graph-based abuse detection platform for ads performs multi-hop pattern matching directly against operational relational data using ISO GQL. For instance, when an account is flagged for suspicious activity, the platform does real-time traversals to uncover all connected signals across the graph. This allows security systems to identify and disable entire coordinated fraud rings quickly rather than handling individual accounts sequentially.

Here’s how it works. The following query uses full-text keyword search and vector similarity search to traverse connected entities across multiple hops to identify a target entity linked to known suspicious activity. Note that the query is illustrative and the field names have been anonymized.

code_block <ListValue: [StructValue([('code', "GRAPH CentralGraph (Illustrative Query)\r\n-- 1. Multi-hop Graph Traversal: Trace relationship paths between entities\r\nMATCH (n1:Entity_1 {id: $seed_entity_id})-[r1:Relationship_1]->(n2:Entity_2)<-[r2:Relationship_2]-(n3:Entity_3)\r\nMATCH (n3)-[r3:Relationship_3]->(n4:Entity_4)<-[r4:Relationship_3]-(n5:Entity_1)-[r5:Relationship_4]->(n6:Entity_5)\r\nWHERE n5.status = 'FLAGGED'\r\n-- 2. Full-Text Search: Filter entities by text description keywords\r\n AND SEARCH(n3.description_text, 'suspicious activity')\r\n-- 3. Vector Search: Match similar entity embeddings for behavioral anomaly detection\r\n AND VECTOR_SEARCH(n6.embedding, $target_embedding, top_k => 5) > 0.85\r\nRETURN n1.id AS TargetEntity, n3.id AS LinkedEntity, n5.id AS FlaggedEntity, n6.id AS SimilarEntity"), ('language', ''), ('caption', <wagtail.rich_text.RichText object at 0x7f1e8d74ac50>)])]>

Impact of adding real-time graph intelligence

Today, the graph-based abuse detection platform operates as a unified, Google-wide defense platform across a live graph of over 500 billion nodes and 1 trillion edges. Further, bringing ability to do multi-hop graph queries to real-time enforcement has fundamentally changed how Google stops abuse, delivering big wins for customers and end users:

Graph capabilities for every industry

Google's graph-based abuse detection platform for ads shows what Spanner Graph can deliver under the world’s most demanding scale and latency requirements. Because this unified relational and graph architecture is built directly into Spanner, enterprises across a variety of industries can use the same foundation to solve their own complex pattern-matching and fraud challenges:

Get started

Ready to bring real-time graph intelligence to your operational data at scale? 

Originally published by Google Cloud Blog ↗ · rebuilt here from its own full-text RSS feed · all rights remain with the publisher, please read and support them there.