Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dbt mesh x sl faqs #5867

Merged
merged 12 commits into from
Aug 8, 2024
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 @@ -261,12 +261,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 global project that contains your Semantic Layer configurations.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- Then as you build your Semantic Layer, you can cross reference dbt models 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')`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- 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('analytics', 'fct_orders') # ref('project_name', 'model_name')
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
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 to reference the `fct_orders` model in the `jaffle_finance` project.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
<br />
Loading