Introducing BigQuery Graph: Unlock hidden relationships in your data

Today, we’re thrilled to announce that BigQuery Graph is now available in preview. With BigQuery Graph, we’ve built an easy-to-use, highly scalable graph analytics solution for data engineers, data analysts, data scientists, and AI developers, empowering them to model, analyze and visualize massive-scale relationships in an entirely new way. 

As data changes and grows, it’s important  to understand how different entities such as people, places, and products relate to one another. After all, data is more meaningful when we know how entities are interconnected. With traditional SQL, to find a “friend of a friend of a friend” requires multiple nested JOIN operations, which are usually challenging to read and write, and the performance degrades exponentially at scale. Finding the “blast radius” of a supply chain disruption during a storm requires multi-hop traversals, a full-scale graph analysis. To better solve this challenge, data is often modeled as a graph representation of the physical world around us, which can be better at finding complex and hidden relationships than traditional relational data structures. 

Graph challenges faced by enterprises across industries 

Graph technology has been broadly used across industries for fraud detection, recommendation engines, supply chain management, knowledge graph applications, and many others. However, users face some major challenges in adopting graphs:

  • Data silos and maintenance overhead: Having to store and maintain graph data in a standalone graph database creates data silos, data inconsistency, additional cost — not to mention extra operational overhead. 

  • Lack of graph expertise: Adopting graph technologies often requires learning a new language, paradigm, and potentially a new database. At the same time, organizations’ investment in SQL expertise are less relevant.    

  • Performance and scalability concerns: Many standalone graph databases work well when traversing the graph from a handful of nodes, but struggle to scale to billions of entities as business demands grow.

BigQuery Graph addresses many of these challenges by supporting:

  • Built-in graph query experience: A more intuitive graph query language (GQL) allows you to find patterns and traverse relationships among disparate data sets, based on the newest ISO GQL standard. 

  • Unified relational and graph data models: Tight integration between graph and relational data models allows you to choose the best tool to model the data on a single source of truth without data duplication or data movement. Full interoperability between graph queries and SQL allows you to continue to leverage existing SQL skills, while taking advantage of the expressiveness of graph queries.  

  • Graph over structured and unstructured data: Rich AI functions, vector and full-text search capabilities are supported with BigQuery Graph, allowing you to use semantic meaning, keyword search on graphs, bridging the gaps of structured and unstructured data. 

  • Graph visualization: You can easily explore, investigate, and explain how your data is connected in an intuitive graph format using BigQuery Studio notebook and Jupyter Notebook.

  • Industry-leading ease of use, performance and scalability: BigQuery Graph is built upon BigQuery’s serverless, scalable, cost-effective and distributed analytics engine that can scale to billions of nodes and edges. 

  • Integration with Spanner Graph: This provides a unified graph schema and graph query language that serve a full spectrum of real-time (Spanner Graph) and batch graph needs (BigQuery Graph). You can also build a virtual graph by combining the latest data from Spanner and historical data from BigQuery without data movement using federated queries. 

  • Chat with your graph: Very soon, you will be able to chat directly with graphs with the Conversational Analytics Agent (stay tuned). 

Common BigQuery Graph use cases 

BigQuery Graph opens up a realm of possibilities across industries for building intelligent applications: 

  • Financial fraud detection: Analyze complex relationships among users, accounts, and transactions to identify suspicious patterns and anomalies, such as money laundering and irregular connections between entities, which can be difficult to detect using relational databases.

  • Customer 360: Track customer relationships, preferences, and purchase histories. Gain a holistic understanding of each customer, enable personalized recommendations, targeted marketing campaigns, and improved customer service experiences.

  • Social networks: Capture user activities and interactions and use graph pattern matching for friend recommendations and content discovery.

  • Manufacturing and supply chain management: Use graph patterns for efficient stockout analysis, cost rollups, and compliance checks by modeling parts, suppliers, orders, availability, and defects in the graph.

  • Healthcare: Capture patient relationships, conditions, diagnosis, and treatments to facilitate patient similarity analysis and treatment planning.

  • Transportation optimization: Model places, connections, distances, and costs in the graph, and then use graph queries to find the optimal route.

BigQuery Graph in the real-world 

Many customers across industries have leveraged BigQuery Graph to solve real-world business challenges. Here are a few examples of how they are putting these capabilities into practice:

BioCorteX: drug discovery 

“Understanding disease isn’t about collecting more data; it’s about understanding the relationships within that data. By leveraging pathway search in BigQuery Graph at a massive scale, reaching depths of 7+ hops, we are finally able to see more of the human metabolism map. This level of scale is what allows us to move beyond trial and error, identifying the precise biological levers that need to be pulled to cure complex diseases. We aren’t just guessing anymore, we’re emulating life at the speed of compute.” – Nik Sharma, CEO and Cofounder, BioCorteX

Curve: fraud detection 

“By implementing BigQuery Graph, we have successfully moved away from the previous limited sql-based approach to a more scalable solution for fraud detection network analysis. This has allowed us to detect sophisticated fraud networks by uncovering hidden connections between seemingly unrelated accounts and transactions. This transition from traditional relational queries to graph-based analytics has showcased measurable business impact with ~£9.1M of savings. This shift has not only improved the precision of fraud detection but has also provided a scalable foundation for protecting the ecosystem without adding significant operational overhead.” – Francis Darby, VP Data & ML, Curve

Virgin Media 02: fraud detection 

“At Virgin Media O2, we are constantly evolving our defenses to stay ahead of increasingly sophisticated fraud networks. We’ve added a powerful new layer to our already robust fraud alerting system. Using BigQuery Graph, we can now execute complex 4-hop queries that map the hidden relationships between accounts, devices, and activities. This deeper visibility allowed us to identify networks of suspicious addresses. This doesn’t just catch fraud; it acts as an early warning system, flagging new connections to known risk networks before they can cause damage.” — Jonathon Ford, Director Data Applications, Virgin Media O2

How to use BigQuery Graph 

BigQuery Graph is more than just a new feature; it’s a new way of thinking about data, empowering you to ask bigger questions, uncover deeper insights, and solve your most challenging problems.

You can get started in three simple steps:

Step 1: Create graph schemas on top of the relationship tables using DDL with a single copy of data.

Create a finance graph by mapping relational tables into “Account”, “Person”, “Loan” nodes and their relationships “Transfers”, “Owns”, “Repays” via edges.

1

code_block
<ListValue: [StructValue([(‘code’, ‘CREATE PROPERTY GRAPH graph_db.FinGraphrnNODE TABLES (rn graph_db.Account KEY(id),rn graph_db.Person KEY(id),rn graph_db.Loan KEY(id)rn) rnEDGE TABLES (rn graph_db.Transfers rn KEY (id, to_id, timestamp) rn SOURCE KEY (id) REFERENCES Account (id)rn DESTINATION KEY (to_id) REFERENCES Account (id), rn graph_db.Ownsrn KEY (id, account_id, timestamp) rn SOURCE KEY (id) REFERENCES Person (id)rn DESTINATION KEY (account_id) REFERENCES Account(id),rn graph_db.Repaysrn KEY (id, loan_id, timestamp) rn SOURCE KEY (id) REFERENCES Person (id)rn DESTINATION KEY (loan_id) REFERENCES Loan(id)’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x7f3d5824c370>)])]>

Step 2: Use intuitive SQL/GQL to traverse data relationships and find hidden connectivities.

Find the accounts owned by Jacob and the loans he repays from those accounts:

code_block
<ListValue: [StructValue([(‘code’, ‘GRAPH graph_db.FinGraphrnMATCHrn (person:Person {name: “Jacob”}) rn -[own:Owns]->(account:Account)rn -[repay:Repays]->(loan:Loan)rnRETURNrn account.id AS account_id,rn loan.id AS loan_id’), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x7f3d5824c490>)])]>

Combine vector search with graph traversals to find fraudster-like accounts and their transfer activities within 1-6 hops:

code_block
<ListValue: [StructValue([(‘code’, “DECLARE similar_account_to_fraudster DEFAULT ((rn SELECT array_agg(base.id)rn FROM VECTOR_SEARCH(TABLE graph_db.Account, ’embedding’,rn (SELECT * FROM graph_db.Account WHERE id=102), ’embedding’, rn top_k => 6)rn));rnGRAPH graph_db.FinGraphrnMATCHrn (person:Person)-[own:Owns]->rn (account:Account)-[transfer:Transfers]->{1,6}rn (to_account:Account)rnWHERE to_account.id IN rn UNNEST(similar_account_to_fraudster)rnRETURNrn person.id AS person_id,rn account.id AS src_account,rn to_account.id AS to_account”), (‘language’, ”), (‘caption’, <wagtail.rich_text.RichText object at 0x7f3d5824c340>)])]>

Step 3: Visualize graph results to detect connectivity of disparate data in a more intuitive way in BigQuery Studio notebook.

2

If you are looking for a specialized graph visualization tool, BigQuery Graph has integrated with industry leading partners including G.V(), Graphistry, Kineviz, Linkurious. They allow you to see a visualization of BigQuery Graph query results outside the Google Cloud console.

Ready to get started?

The future of data analysis is connected. With BigQuery Graph, you have the power to unlock that connectivity and transform your business into actionable insights grounded with your enterprise knowledge. Start exploring today and unleash the power of your data’s interconnected relationships!