You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graph semanitcs supports two primary approaches for working with graphs: transient graphs created in-memory for each query, and persistent graphs defined as graph models and snapshots within the database. This article provides best practices for both methods, enabling you to select the optimal approach and use KQL graph semantics efficiently.
14
+
Graph semantics supports two primary approaches for working with graphs: transient graphs created in-memory for each query, and persistent graphs defined as graph models and snapshots within the database. This article provides best practices for both methods, enabling you to select the optimal approach and use KQL graph semantics efficiently.
15
15
16
16
This guidance covers:
17
17
@@ -29,7 +29,7 @@ There are two approaches for working with graphs: transient and persistent.
29
29
30
30
### Transient graphs
31
31
32
-
Created dynamically using the [`make-graph`](make-graph-operator.md) operator. These graphs exist only during query execution and are optimal for adhoc or exploratory analysis on small to medium datasets.
32
+
Created dynamically using the [`make-graph`](make-graph-operator.md) operator. These graphs exist only during query execution and are optimal for ad-hoc or exploratory analysis on small to medium datasets.
33
33
34
34
### Persistent graphs
35
35
@@ -124,7 +124,7 @@ Use the [arg_max aggregation](arg-max-aggregation-function.md) function to deter
124
124
125
125
**Step 3: Create helper functions**
126
126
127
-
Ensure only the materialized component is used and apply additional filters:
127
+
Ensure only the materialized component is used and apply another filters:
128
128
129
129
```kusto
130
130
.create function currentEmployees () {
@@ -246,7 +246,7 @@ let assetHierarchy = datatable(source:string, destination:string)
246
246
];
247
247
```
248
248
249
-
The employees, sensors, and other entities and relationships do not share a canonical data model. The [union operator](union-operator.md) can be used to combine and standardize the data.
249
+
The employees, sensors, and other entities and relationships don't share a canonical data model. The [union operator](union-operator.md) can be used to combine and standardize the data.
250
250
251
251
The following query joins the sensor data with the time series data to identify sensors with abnormal readings, then uses a projection to create a common model for the graph nodes.
252
252
@@ -310,15 +310,15 @@ The projection in `graph-match` shows that the temperature sensor exhibited an a
310
310
311
311
## Best practices for persistent graphs
312
312
313
-
Persistent graphs, defined using [graph models](../management/graph/graph-model-overview.md) and [graph snapshots](../management/graph/graph-snapshot-overview.md), provide robust solutions for advanced graph analytics needs. These graphs excel in scenarios requiring repeated analysis of large, complex, or evolving data relationships, and facilitate collaboration by enabling teams to share standardized graph definitions and consistent analytical results. By persisting graph structures in the database, this approach significantly enhances performance for recurring queries and supports sophisticated versioning capabilities.
313
+
Persistent graphs, defined using [graph models](../management/graph/graph-model-overview.md), and [graph snapshots](../management/graph/graph-snapshot-overview.md), provide robust solutions for advanced graph analytics needs. These graphs excel in scenarios requiring repeated analysis of large, complex, or evolving data relationships, and facilitate collaboration by enabling teams to share standardized graph definitions and consistent analytical results. By persisting graph structures in the database, this approach significantly enhances performance for recurring queries and supports sophisticated versioning capabilities.
314
314
315
315
### Use schema and definition for consistency and performance
316
316
317
317
A clear schema for your graph model is essential, as it specifies node and edge types along with their properties. This approach ensures data consistency and enables efficient querying. Utilize the `Definition` section to specify how nodes and edges are constructed from your tabular data through `AddNodes` and `AddEdges` steps.
318
318
319
-
### Leverage static and dynamic labels for flexible modeling
319
+
### Use static and dynamic labels for flexible modeling
320
320
321
-
When modeling your graph, you can utilize both static and dynamic labeling approaches for optimal flexibility. Static labels are ideal for well-defined node and edge types that rarely change—define these in the `Schema` section and reference them in the `Labels` array of your steps. For cases where node or edge types are determined by data values (for example, when the type is stored in a column), use dynamic labels by specifying a `LabelsColumn` in your step to assign labels at runtime. This approach is especially useful for graphs with heterogeneous or evolving schemas. Both mechanisms can be effectively combined—you can define a `Labels` array for static labels and also specify a `LabelsColumn` to incorporate additional labels from your data, providing maximum flexibility when modeling complex graphs with both fixed and data-driven categorization.
321
+
When modeling your graph, you can utilize both static and dynamic labeling approaches for optimal flexibility. Static labels are ideal for well-defined node and edge types that rarely change—define these in the `Schema` section and reference them in the `Labels` array of your steps. For cases where node or edge types are determined by data values (for example, when the type is stored in a column), use dynamic labels by specifying a `LabelsColumn` in your step to assign labels at runtime. This approach is especially useful for graphs with heterogeneous or evolving schemas. Both mechanisms can be effectively combined—you can define a `Labels` array for static labels and also specify a `LabelsColumn` to incorporate labels from your data, providing maximum flexibility when modeling complex graphs with both fixed and data-driven categorization.
322
322
323
323
#### Example: Using dynamic labels for multiple node and edge types
324
324
@@ -376,7 +376,7 @@ Large-scale multitenant environments often exhibit the following characteristics
376
376
377
377
### Partitioning by natural boundaries
378
378
379
-
The most effective approach for managing large-scale graphs is partitioning by natural boundaries, typically tenant identifiers or organizational units:
379
+
The most effective approach for managing large-scale graphs is partitioning by natural boundaries, typically tenant identifiers, or organizational units:
380
380
381
381
**Key partitioning strategies:**
382
382
@@ -413,14 +413,14 @@ The most cost-effective strategy combines both transient and persistent graphs b
413
413
414
414
#### Small to medium tenants (99.9% of tenants)
415
415
416
-
Use **transient graphs** for the majority of tenants:
416
+
Use **transient graphs** for most tenants:
417
417
418
418
**Advantages:**
419
419
420
420
-**Always up-to-date data** - No snapshot maintenance required
421
421
-**Lower operational overhead** - No graph model or snapshot management
422
-
-**Cost-effective** - No additional storage costs for graph structures
423
-
-**Immediate availability** - No pre-processing delays
422
+
-**Cost-effective** - No extra storage costs for graph structures
423
+
-**Immediate availability** - No preprocessing delays
424
424
425
425
**Implementation pattern:**
426
426
@@ -518,22 +518,29 @@ graph("ContosoOrgChart")
518
518
5.**Resource management** - Use workload groups to prevent large tenant queries from affecting smaller tenants
519
519
6.**Cost optimization** - Regularly review and optimize the persistent/transient threshold based on actual usage patterns
520
520
521
-
This hybrid approach enables organizations to provide always-current data analysis for the majority of tenants while delivering enterprise-scale analytics capabilities for the largest tenants, optimizing both cost and performance across the entire customer base.
521
+
This hybrid approach enables organizations to provide always-current data analysis for most tenants while delivering enterprise-scale analytics capabilities for the largest tenants, optimizing both cost and performance across the entire customer base.
0 commit comments