Skip to content

Commit

Permalink
add dbt mesh x sl faqs (#5867)
Browse files Browse the repository at this point in the history
this pr adds an faq in various locations so we can provide users with
info on how to best implement dbt mesh with the SL.

needs to be reviewed by PM

---------

Co-authored-by: nataliefiann <[email protected]>
Co-authored-by: Jeremy Cohen <[email protected]>
  • Loading branch information
3 people authored Aug 8, 2024
1 parent 6b44ac1 commit 266c6b4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
4 changes: 4 additions & 0 deletions website/docs/best-practices/how-we-mesh/mesh-5-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,16 @@ Historical limitations required customers to "duplicate" projects so that one ac

<DetailsToggle alt_header="How does the dbt Semantic Layer relate to and work with dbt Mesh?">

import SLMeshFAQs from '/snippets/_sl-dbt-mesh-faq.md';

The [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl) and dbt Mesh are complementary mechanisms enabled by dbt Cloud that work together to enhance the management, usability, and governance of data in large-scale data environments.

The Semantic Layer in dbt Cloud allows teams to centrally define business metrics and dimensions. It ensures consistent and reliable metric definitions across various analytics tools and platforms.

dbt Mesh enables organizations to split their data architecture into multiple domain-specific projects, while retaining the ability to reference “public” models across projects. It is also possible to reference a “public” model from another project for the purpose of defining semantic models and metrics. Your organization can have multiple dbt projects feed into a unified semantic layer, ensuring that metrics and dimensions are consistently defined and understood across these domains.

<SLMeshFAQs/>

</DetailsToggle>

<DetailsToggle alt_header="How does dbt Explorer relate to and work with dbt Mesh?">
Expand Down
8 changes: 8 additions & 0 deletions website/docs/docs/use-dbt-semantic-layer/sl-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ We are currently working on introducing more fine-grained access controls, inclu

## Implementation

<Expandable alt_header="How can I implement dbt Mesh with the dbt Semantic Layer">

import SLMeshFAQs from '/snippets/_sl-dbt-mesh-faq.md';

<SLMeshFAQs/>

</Expandable>

<Expandable alt_header="Which ‘staging layer’ should the dbt Semantic Layer talk to? Raw, staging, or marts?">

We recommend to build your semantic layer on top of the [marts layer](/best-practices/how-we-structure/4-marts), which represents the clean and transformed data from your dbt models.
Expand Down
1 change: 1 addition & 0 deletions website/docs/guides/mesh-qs.md
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ Here are some additional resources to help you continue your journey:

- [How we build our dbt mesh projects](https://docs.getdbt.com/best-practices/how-we-mesh/mesh-1-intro)
- [dbt Mesh FAQs](https://docs.getdbt.com/best-practices/how-we-mesh/mesh-5-faqs)
- [Implement dbt Mesh with the Semantic Layer](/docs/use-dbt-semantic-layer/sl-faqs#how-can-i-implement-dbt-mesh-with-the-dbt-semantic-layer)
- [Cross-project references](/docs/collaborate/govern/project-dependencies#how-to-write-cross-project-ref)
- [dbt Explorer](/docs/collaborate/explore-projects)

Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/sl-snowflake-qs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ You've learned how to:
- Build, test, and manage dbt Cloud projects, focusing on metrics and semantic layers.
- Run production jobs and query metrics with our available integrations.
For next steps, you can start defining your own metrics and learn additional configuration options such as [exports](/docs/use-dbt-semantic-layer/exports), [fill null values](/docs/build/advanced-topics), and more.
For next steps, you can start defining your own metrics and learn additional configuration options such as [exports](/docs/use-dbt-semantic-layer/exports), [fill null values](/docs/build/advanced-topics), [implementing dbt Mesh with the Semantic Layer](/docs/use-dbt-semantic-layer/sl-faqs#how-can-i-implement-dbt-mesh-with-the-dbt-semantic-layer), and more.
Here are some additional resources to help you continue your journey:
Expand Down
30 changes: 30 additions & 0 deletions website/snippets/_sl-dbt-mesh-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
When using the dbt Semantic Layer in a [dbt Mesh](/best-practices/how-we-mesh/mesh-1-intro) setting, we recommend the following:

- You have one standalone project that contains your semantic models and metrics.
- Then as you build your Semantic Layer, you can [cross-reference dbt models](/docs/collaborate/govern/project-dependencies) across your various projects or packages to create your semantic models using the [two-argument `ref` function](/reference/dbt-jinja-functions/ref#ref-project-specific-models)( `ref('project_name', 'model_name')`).
- Your dbt Semantic Layer project serves as a global source of truth across the rest of your projects.

#### Usage example
For example, let's say you have a public model (`fct_orders`) that lives in the `jaffle_finance` project. As you build your semantic model, use the following syntax to ref the model:

<File name="models/metrics/semantic_model_name.yml">

```yaml
semantic_models:
- name: customer_orders
defaults:
agg_time_dimension: first_ordered_at
description: |
Customer grain mart that aggregates customer orders.
model: ref('jaffle_finance', 'fct_orders') # ref('project_name', 'model_name')
entities:
...rest of configuration...
dimensions:
...rest of configuration...
measures:
...rest of configuration...
```
</File>
Notice that in the `model` parameter, we're using the `ref` function with two arguments to reference the public model `fct_orders` defined in the `jaffle_finance` project.
<br />

0 comments on commit 266c6b4

Please sign in to comment.