Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer
Note
This feature is currently in public preview. Functionality and syntax are subject to change before General Availability.
Persistent graphs enable you to store, manage, and query graph data structures at scale. Unlike transient graphs created with the make-graph operator, persistent graphs are durable database objects that persist beyond individual query executions, providing enterprise-grade graph analytics capabilities.
Overview
Persistent graphs consist of two primary components:
- Graph models: Define the structure and schema of your graph
- Graph snapshots: Persistent instances of graph models that you can query
This architecture provides both flexibility in defining graph schemas and efficiency in querying graph data at scale.
Key benefits
Persistent graphs offer significant advantages for enterprise-scale graph analytics:
- Durable storage: Graph models and snapshots persist in database metadata for long-term availability
- Scalability: Handle large graphs that exceed single-node memory limitations
- Reusability: Multiple users and applications can query the same graph structure without reconstruction
- Performance optimization: Eliminate graph construction overhead for repeated queries
- Schema support: Structured definitions for different node and edge types with their properties
- Version control: Multiple snapshots enable representation of graphs at different points in time
Graph models
A graph model defines the specifications of a graph stored in your database metadata. It includes:
- Schema definition: Node and edge types with their properties
- Data source mappings: Instructions for building the graph from tabular data
- Labels: Both static (predefined) and dynamic (generated at runtime) labels for nodes and edges
Graph models contain the blueprint for creating graph snapshots, not the actual graph data.
Managing graph models
The following commands are available for managing graph models:
Command | Description |
---|---|
.create-or-alter graph_model | Creates a new graph model or alters an existing one |
.show graph_model | Displays details of a specific graph model |
.show graph_models | Lists all graph models in the database |
.drop graph_model | Removes a graph model |
Graph snapshots
A graph snapshot is the actual graph instance materialized from a graph model. It represents:
- A specific point-in-time view of the data as defined by the model
- The nodes, edges, and their properties in a queryable format
- A self-contained entity that persists until explicitly removed
Snapshots are the entities you query when working with persistent graphs.
Managing graph snapshots
The following commands are available for managing graph snapshots:
Command | Description |
---|---|
.make graph_snapshot | Creates a new graph snapshot from a graph model |
.show graph_snapshot | Displays details of a specific graph snapshot |
.show graph_snapshots | Lists all graph snapshots in the database |
.drop graph_snapshot | Removes a single graph snapshot |
.drop graph_snapshots | Removes multiple graph snapshots based on criteria |
Workflow
The typical workflow for creating and using persistent graphs follows these steps:
- Create a graph model - Define the structure and data sources for your graph
- Create a graph snapshot - Materialize the graph model into a queryable snapshot
- Query the graph snapshot - Use KQL graph operators to analyze the graph data
- Manage lifecycle - Create new snapshots as needed and drop old ones
Querying persistent graphs
Once a graph snapshot is created, it can be queried using the graph
function followed by other KQL graph operators:
graph("MyGraphModel")
| graph-match (n)-[e]->(m)
project n, e, m
To query a specific snapshot, provide the snapshot name:
graph("MyGraphModel", "MyGraphSnapshot")
| graph-match (n)-[e]->(m)
project n, e, m
The graph-match
operator enables pattern matching and traversal operations, while graph-shortest-paths
helps find optimal connections between entities. The graph-to-table
operator converts graph results back to tabular format.
Key considerations
This section describes key considerations and current limitations of graph models and snapshots.
Snapshot limitations
Persistent graphs have the following limitations:
- Regular database limit: Maximum of 5,000 graph snapshots per database
- Free virtual cluster limit: Maximum of 500 graph snapshots per database
- Snapshot creation time: Limited to 1 hour