Stay organized with collections
Save and categorize content based on your preferences.
Spanner Graph combines graph database capabilities with
Spanner scalability, availability, and consistency.
Spanner Graph supports an ISO Graph Query Language (GQL)-compatible graph
query interface and enables interoperability between relational and graph
models.
Spanner Graph lets you map tables to property graphs using declarative
schema without data migration, bringing graphs to tabular datasets. You can also
late-bind data model choices per query, which helps you choose the right tool
for your workflows.
Graphs provide a natural mechanism for representing relationships in data.
Example use cases for graph databases include fraud detection, recommendations,
cyber security, community detection, knowledge graphs, customer 360, data
cataloging, and lineage tracking.
Traditionally, applications represent this type of graph data as tables in a
relational database, using multiple joins to traverse the graph. Expressing
graph traversal logic in SQL creates complex queries that are difficult to
write, maintain, and debug.
The graph interface in Spanner Graph lets you navigate relationships and
identify patterns in the graph in intuitive ways. In addition, Spanner Graph
provides graph-optimized storage and query enhancements suited for online
analytical and transactional graph workloads, all built into
Spanner's core capabilities.
This approach makes Spanner Graph the ideal solution for even
mission-critical graph applications. In particular, Spanner's
transparent sharding scales elastically to very large datasets. It uses
massively parallel processing without user intervention.
Use cases for Spanner Graph
You can use Spanner Graph to build many types of online Graph applications,
including the following:
Detect financial fraud: Analyze complex relationships among users,
accounts, and transactions to identify suspicious patterns and anomalies,
such as money laundering and unusual connections between entities, which can
be difficult to detect using relational databases.
Track customer relationships: 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.
Capture social networks: Capture user activities and interactions, and
use graph pattern matching for friend recommendations and content discovery.
Manage manufacturing and supply chains: Model parts, suppliers, orders,
availability, and defects in the graph to analyze impact, roll up costs, and
check compliance.
Analyze healthcare data: Capture patient relationships, conditions,
diagnoses, and treatments to facilitate patient similarity analysis and
treatment planning.
Manage supply chains: Given a shipment routing plan, evaluate route
segments to identify violations of segment rules.
Key capabilities
Spanner Graph is a multi-model database that integrates graph, relational,
search, and AI capabilities. It offers high performance and scalability,
delivering the following:
Native graph experience: The ISO GQL interface offers a familiar,
purpose-built graph experience that's based on open standards.
Build GraphRAG workflow applications: Spanner Graph integrates with
LangChain to help you build GraphRAG applications. While conventional
retrieval-augmented generation (RAG) uses vector search to provide context
to a large language model (LLM), it can't use the implicit relationships in
your data. GraphRAG overcomes this limitation by building a graph from your
data to capture these complex relationships. It then combines graph search
(for relationship-based context) with vector search (for semantic
similarity), generating more accurate, relevant, and complete answers than
using either method alone. For more information, see
Build LLM-powered applications using LangChain.
To learn how you can use Spanner Graph with
Vertex AI to build infrastructure for a GraphRAG-capable generative
AI application, see
GraphRAG infrastructure for generative AI using Vertex AI and Spanner Graph.
Unified relational and graph: Full interoperability between GQL and SQL
breaks down data silos. This lets you choose the optimal tool for each use
case, without any operational overheads to extract, transform, and load
(ETL).
Built-in search capabilities: Rich vector and full-text search
capabilities are integrated with graph, letting you use semantic meaning and
keywords in graph analysis.
AI-powered insights: Deep integration with Vertex AI unlocks a
suite of AI models directly in Spanner Graph, helping you accelerate
your AI workflows.
Scalability, availability, and consistency: Spanner's
established scalability, availability, and consistency provide a solid
foundation.
Get support
If you have additional questions about Spanner Graph and its features after
reading this user guide, send an email to
spanner-graph-feedback@google.com.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Spanner Graph overview\n\n| **PostgreSQL interface note:** The examples in topics for Spanner Graph are intended for GoogleSQL-dialect databases. Spanner Graph doesn't support the PostgreSQL interface.\n\n\u003cbr /\u003e\n\n\n| **Note:** This feature is available with the Spanner Enterprise edition and Enterprise Plus edition. For more information, see the [Spanner editions overview](/spanner/docs/editions-overview).\n\n\u003cbr /\u003e\n\nSpanner Graph combines graph database capabilities with\n[Spanner](/spanner/docs) scalability, availability, and consistency.\nSpanner Graph supports an ISO Graph Query Language (GQL)-compatible graph\nquery interface and enables interoperability between relational and graph\nmodels.\n\nSpanner Graph lets you map tables to property graphs using declarative\nschema without data migration, bringing graphs to tabular datasets. You can also\nlate-bind data model choices per query, which helps you choose the right tool\nfor your workflows.\n\nTo get started with Spanner Graph, see\n[Set up and query Spanner Graph](/spanner/docs/graph/set-up) and the\n[Spanner Graph codelab](https://codelabs.developers.google.com/codelabs/spanner-graph-getting-started).\n\nBenefits of Spanner Graph databases\n-----------------------------------\n\nGraphs provide a natural mechanism for representing relationships in data.\nExample use cases for graph databases include fraud detection, recommendations,\ncyber security, community detection, knowledge graphs, customer 360, data\ncataloging, and lineage tracking.\n\nTraditionally, applications represent this type of graph data as tables in a\nrelational database, using multiple joins to traverse the graph. Expressing\ngraph traversal logic in SQL creates complex queries that are difficult to\nwrite, maintain, and debug.\n\nThe graph interface in Spanner Graph lets you navigate relationships and\nidentify patterns in the graph in intuitive ways. In addition, Spanner Graph\nprovides graph-optimized storage and query enhancements suited for online\nanalytical and transactional graph workloads, all built into\nSpanner's core capabilities.\n\nThis approach makes Spanner Graph the ideal solution for even\nmission-critical graph applications. In particular, Spanner's\ntransparent sharding scales elastically to very large datasets. It uses\nmassively parallel processing without user intervention.\n\nUse cases for Spanner Graph\n---------------------------\n\nYou can use Spanner Graph to build many types of online Graph applications,\nincluding the following:\n\n- **Detect financial fraud**: Analyze complex relationships among users,\n accounts, and transactions to identify suspicious patterns and anomalies,\n such as money laundering and unusual connections between entities, which can\n be difficult to detect using relational databases.\n\n- **Track customer relationships**: Track customer relationships, preferences,\n and purchase histories. Gain a holistic understanding of each customer,\n enable personalized recommendations, targeted marketing campaigns, and\n improved customer service experiences.\n\n- **Capture social networks**: Capture user activities and interactions, and\n use graph pattern matching for friend recommendations and content discovery.\n\n- **Manage manufacturing and supply chains**: Model parts, suppliers, orders,\n availability, and defects in the graph to analyze impact, roll up costs, and\n check compliance.\n\n- **Analyze healthcare data**: Capture patient relationships, conditions,\n diagnoses, and treatments to facilitate patient similarity analysis and\n treatment planning.\n\n- **Manage supply chains**: Given a shipment routing plan, evaluate route\n segments to identify violations of segment rules.\n\nKey capabilities\n----------------\n\nSpanner Graph is a multi-model database that integrates graph, relational,\nsearch, and AI capabilities. It offers high performance and scalability,\ndelivering the following:\n\n- **Native graph experience**: The ISO GQL interface offers a familiar,\n purpose-built graph experience that's based on open standards.\n\n- **Build GraphRAG workflow applications** : Spanner Graph integrates with\n LangChain to help you build GraphRAG applications. While conventional\n retrieval-augmented generation (RAG) uses vector search to provide context\n to a large language model (LLM), it can't use the implicit relationships in\n your data. GraphRAG overcomes this limitation by building a graph from your\n data to capture these complex relationships. It then combines graph search\n (for relationship-based context) with vector search (for semantic\n similarity), generating more accurate, relevant, and complete answers than\n using either method alone. For more information, see\n [Build LLM-powered applications using LangChain](/spanner/docs/langchain).\n To learn how you can use Spanner Graph with\n Vertex AI to build infrastructure for a GraphRAG-capable generative\n AI application, see\n [GraphRAG infrastructure for generative AI using Vertex AI and Spanner Graph](/architecture/gen-ai-graphrag-spanner).\n\n- **Unified relational and graph**: Full interoperability between GQL and SQL\n breaks down data silos. This lets you choose the optimal tool for each use\n case, without any operational overheads to extract, transform, and load\n (ETL).\n\n- **Built-in search capabilities**: Rich vector and full-text search\n capabilities are integrated with graph, letting you use semantic meaning and\n keywords in graph analysis.\n\n- **AI-powered insights**: Deep integration with Vertex AI unlocks a\n suite of AI models directly in Spanner Graph, helping you accelerate\n your AI workflows.\n\n- **Scalability, availability, and consistency**: Spanner's\n established scalability, availability, and consistency provide a solid\n foundation.\n\nGet support\n-----------\n\nIf you have additional questions about Spanner Graph and its features after\nreading this user guide, send an email to\n[spanner-graph-feedback@google.com](mailto:spanner-graph-feedback@google.com).\n\nWhat's next\n-----------\n\n- Get started with the [Spanner Graph codelab](https://codelabs.developers.google.com/codelabs/spanner-graph-getting-started).\n- Set up and query [Spanner Graph](/spanner/docs/graph/set-up).\n- Learn about the [Spanner Graph schema](/spanner/docs/graph/schema-overview).\n- Learn how to create, update, or drop a [Spanner Graph schema](/spanner/docs/graph/create-update-drop-schema)."]]