AI & ML

From Operational to Analytical: Building Unified Graph Solutions with Spanner and BigQuery

Apr 14, 2026 5 min read views

Understanding relationships within your data is essential for uncovering insights and building intelligent applications. Yet managing operational (OLTP) and analytical (OLAP) graph workloads typically requires juggling separate databases, maintaining fragile data pipelines, and navigating complex integrations. This fragmentation creates data silos, drives up operational costs, and constrains scalability.

Today, we're introducing a unified graph database and analytics solution powered by Spanner Graph and BigQuery Graph. The solution combines both platforms with recommended deployment blueprints and getting-started guides for common use cases. In this post, we'll explore the solution's components, examine the most prevalent use cases, and share insights from customers already deploying it in production.

Spanner Graph for operational workloads

Spanner Graph reimagines graph data management by unifying graph, relational, search, and generative AI capabilities in a single database. It's built on Spanner's proven unlimited scalability, high availability, and strong consistency guarantees.

Spanner Graph delivers:

  • Integrated table-to-graph mapping: Define graphs directly over existing Spanner relational tables, enabling you to view and query operational data as a graph without duplicating data.

  • Interoperable graph and relational querying: Use ISO-standard Graph Query Language (GQL) for intuitive pattern matching, and combine GQL with SQL in a single query to traverse both graph and tabular data.

  • Advanced search and AI integration: Leverage built-in vector search, full-text search, and Vertex AI integration to retrieve data by semantic meaning and power intelligent applications directly within your database.

Customers are already using Spanner Graph for high-throughput, low-latency applications including identity resolution across millions of entities, dependency mapping in complex environments, data lineage tracking, customer 360 use cases, and real-time fraud detection.

"Open Intelligence is our foundational intelligence layer that securely connects trillions of live data points from clients, partners and WPP in a privacy-first way and is now integrated and powers WPP's agentic marketing platform, WPP Open. Enabled by Google Cloud's Spanner Graph, Open Intelligence is a significant advancement in AI-driven marketing and we are excited about extending the use case for analytical graph workloads on BigQuery Graph." - Rob Marshall, Head of Strategy, Data & Intelligence, WPP

BigQuery Graph for analytical workloads

While Spanner Graph handles active operations, large-scale analysis requires exploring relationships across billions of nodes and edges to identify patterns and query historical data. Just as SQL uses distinct tools for databases and data warehouses, the graph landscape requires specialized tools for different workloads. That's the rationale behind BigQuery Graph.

BigQuery Graph brings connected data analytics directly into your data warehouse. You can map existing BigQuery data to a graph schema and query it with SQL or GQL to uncover hidden relationships in massive datasets without moving data.

Key capabilities include:

  • Integrated table-to-graph mapping: Map existing BigQuery tables to graphs instantly, revealing hidden relationships in your data warehouse without building ETL pipelines or moving data.
  • Interoperable graph and relational querying: Apply GQL's expressive pattern matching to massive historical datasets, and combine SQL with GQL in a single query to merge the familiarity of your data warehouse with powerful graph traversal.
  • Advanced search and AI integration: Use native integration with BigQuery AI for predictive analytics, alongside built-in vector search, full-text search, and geospatial functions to locate connected information across billions of records.

Spanner Graph and BigQuery Graph as a unified solution

While each platform is powerful independently, their true value emerges when deployed together. By connecting your operational and analytical environments, you eliminate data silos and accelerate time-to-insight without compromising database performance.

"Spanner Graph enables Yahoo to unify our data into a connected foundation at a global scale, powering real-time, intelligent decision-making across our agentic advertising platform. This enhances our AI-driven approaches that drive one of the largest digital advertising ecosystems, and we look forward to building on it with BigQuery Graph to unlock deeper analytics and predictive capabilities to power future innovation." - Gabriel DeWitt, Head of Consumer Monetization, Yahoo

1

Consider financial fraud detection: your application can use Spanner Graph to instantly identify a suspicious connection and block a transaction at checkout. Meanwhile, BigQuery Graph can analyze petabytes of historical transaction data to expose the complex, long-term fraud ring behind it.

Here's how these two engines integrate to create an end-to-end graph workflow:

1) A unified graph query and schema experience

A core advantage of this solution is the consistent schema and GQL shared across both platforms. This shared language reduces development time and minimizes context-switching friction.

For example, to find potential fraud rings originating from a specific account in real-time, you would use this Spanner Graph query:

code_block
<ListValue: [StructValue([('code', 'GRAPH FinGraph\r\nMATCH p=(:Account {id: @accountId})-[:Transfers]->{2,5}(:Account)\r\nRETURN PATH_LENGTH(p) AS path_length, TO_JSON(p) AS full_path;'), ('language', ''), ('caption', <wagtail.rich_text.RichText object at 0x7fe84aeddd90>)])]>

To run that same analysis to find all accounts involved in historical fraud rings, the BigQuery Graph query is nearly identical:

code_block
<ListValue: [StructValue([('code', 'GRAPH bigquery.FinGraph\r\nMATCH p=(:Account)-[:Transfers]->{2,5}(:Account)\r\nRETURN PATH_LENGTH(p) AS path_length, TO_JSON(p) AS full_path;'), ('language', ''), ('caption', <wagtail.rich_text.RichText object at 0x7fe84aedd5e0>)])]>

2) Query Spanner data in BigQuery Graph through Data Boost

With Data Boost, you can query Spanner Graph data directly from BigQuery without impacting the performance of your transactional workloads. This allows you to build a "virtual graph" combining real-time operational data from Spanner with historical analytics in BigQuery without moving data.

For instance, you can combine real-time Account and User nodes from Spanner Graph with historical LogIn edges from BigQuery to identify suspicious login patterns across different devices.

To do this, first connect BigQuery to Spanner using the CREATE EXTERNAL SCHEMA statement:

code_block
<ListValue: [StructValue([('code', "CREATE EXTERNAL SCHEMA spanner\r\nOPTIONS (\r\n external_source = 'google-cloudspanner:/projects/PROJECT_ID/instances/INSTANCE/databases/DATABASE',\r\n location = 'LOCATION'\r\n);"), ('language', ''), ('caption', <wagtail.rich_text.RichText object at 0x7fe84aeddc10>)])]>

Next, define a BigQuery Graph, incorporating tables from both Spanner and BigQuery:

CREATE OR REPLACE PROPERTY GRAPH bigquery.FinGraph
 NODE TABLES (
 -- Account and Person are stored in Spanner,
 -- made available in BigQuery through the `CREATE EXTERNAL SCHEMA` statement.
 spanner.Account KEY (account_id),
 spanner.Person KEY (person_id),
 -- Media is stored in BigQuery.
 bigquery.Media KEY (media_id)
 )
 EDGE TABLES (
 -- Transfers and Owns are stored in Spanner.
 spanner.Transfers AS Transfers
 KEY (transfer_id)
 SOURCE KEY(account_id) REFERENCES Account
 DESTINATION KEY(target_account_id) REFERENCES Account,
 spanner.Owns AS Owns
 KEY (person_id, account_id)
 SOURCE KEY(person_id) REFERENCES Person
 DESTINATION KEY(account_id) REFERENCES Account,
 -- LogIn is stored in BigQuery.
 bigquery.LogIn AS LogIn
 KEY (login_id)
 SOURCE KEY(media_id) REFERENCES Media
 DESTINATION KEY(account_id) REFERENCES Account,
 );

With the property graph defined, you can now query across both Spanner (accounts, users, transfers, ownership) and BigQuery (logins, devices) to identify suspicious login patterns:

GRAPH bigquery.FinGraph
MATCH p=(owner:Person)-[:Owns]->
 (:Account)<-[login:LogIn]-
 (media:Media {blocked: true})
RETURN TO_JSON(p) AS full_path
ORDER BY login.time
LIMIT 20;

3) Export BigQuery data into Spanner Graph through reverse ETL

When analytical data needs to power low-latency, real-time queries, reverse ETL moves it back into Spanner without additional pipelines. For instance, you can import historical device data (IP addresses, device IDs) from BigQuery into Spanner Graph to strengthen real-time fraud detection:

EXPORT DATA
 OPTIONS (
 uri = 'https://spanner.googleapis.com/projects/PROJECT_ID/instances/INSTANCE/databases/DATABASE',
 format='CLOUD_SPANNER',
 spanner_options="""{ "table": "Media" }"""
 ) AS 
SELECT * FROM Media;

4) Visualize your graph data

Visualization is essential for analyzing connected data and conducting investigations. Spanner Studio and BigQuery Studio (coming soon) let you visualize graph data directly in your workspace without external tools. For programmatic exploration, Spanner Graph notebook and BigQuery notebooks render query results within your data science workflows.

Graph visualization in action

5) Graph visualization partner integrations

Spanner Graph and BigQuery Graph integrate with leading visualization partners for comprehensive exploration:

  • Kineviz: Combines advanced visualization with analytics via GraphXR.
  • Graphistry: Extracts insights from large datasets using a GPU-accelerated visual graph intelligence platform.
  • G.V(): Offers quick-to-install, high-performance visualization and no-code data exploration.
  • Linkurious: Detects and analyzes threats in connected data via the Linkurious Enterprise platform.

One unified solution for all your graph needs

Together, Spanner Graph and BigQuery Graph provide a unified solution for operational and analytical needs across various use cases:

Domains Spanner Graph BigQuery Graph
Financial Services Instantly blocks anomalous, suspicious transactions. Uncovers complex, long-term fraud rings.
Retail & E-commerce Serves personalized product recommendations on the fly. Analyzes vast purchasing histories to predict demand.
Cybersecurity Isolates active threats and traces attack origins instantly. Models historical vulnerabilities to strengthen defenses.
Healthcare Powers clinical decision support systems at the point of care. Analyzes population health trends and disease risk factors.
Supply Chain Tracks goods globally and alerts teams to immediate disruptions. Identifies systemic bottlenecks to optimize future routing.
Telecommunications Creates a network digital twin for detecting anomalies and root cause analysis in real-time. Analyzes traffic patterns at scale to plan future infrastructure upgrades.

Get started with Spanner Graph and BigQuery Graph today

With Spanner Graph and BigQuery Graph, we're offering a unified graph data management experience across your operational and analytical needs.

Explore Spanner Graph's use cases and setup guide for your operational workloads, and the BigQuery Graph overview and creation guide for your analytical needs. To experience the full power of this combination, check out our unified solution guide and try the codelab.