From 266c6b471bdf0995bcbaa3c3e6eae632dd272f0a Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:46:28 +0100 Subject: [PATCH] add dbt mesh x sl faqs (#5867) 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 <120089939+nataliefiann@users.noreply.github.com> Co-authored-by: Jeremy Cohen --- .../best-practices/how-we-mesh/mesh-5-faqs.md | 4 +++ .../docs/use-dbt-semantic-layer/sl-faqs.md | 8 +++++ website/docs/guides/mesh-qs.md | 1 + website/docs/guides/sl-snowflake-qs.md | 2 +- website/snippets/_sl-dbt-mesh-faq.md | 30 +++++++++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 website/snippets/_sl-dbt-mesh-faq.md diff --git a/website/docs/best-practices/how-we-mesh/mesh-5-faqs.md b/website/docs/best-practices/how-we-mesh/mesh-5-faqs.md index 3443da614a9..1ae49928ae5 100644 --- a/website/docs/best-practices/how-we-mesh/mesh-5-faqs.md +++ b/website/docs/best-practices/how-we-mesh/mesh-5-faqs.md @@ -264,12 +264,16 @@ Historical limitations required customers to "duplicate" projects so that one ac +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. + + diff --git a/website/docs/docs/use-dbt-semantic-layer/sl-faqs.md b/website/docs/docs/use-dbt-semantic-layer/sl-faqs.md index 9a122aa644a..40b84ada40a 100644 --- a/website/docs/docs/use-dbt-semantic-layer/sl-faqs.md +++ b/website/docs/docs/use-dbt-semantic-layer/sl-faqs.md @@ -279,6 +279,14 @@ We are currently working on introducing more fine-grained access controls, inclu ## Implementation + + +import SLMeshFAQs from '/snippets/_sl-dbt-mesh-faq.md'; + + + + + 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. diff --git a/website/docs/guides/mesh-qs.md b/website/docs/guides/mesh-qs.md index f2e02437819..0d13d043059 100644 --- a/website/docs/guides/mesh-qs.md +++ b/website/docs/guides/mesh-qs.md @@ -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) diff --git a/website/docs/guides/sl-snowflake-qs.md b/website/docs/guides/sl-snowflake-qs.md index 367e41083bb..782073fdc38 100644 --- a/website/docs/guides/sl-snowflake-qs.md +++ b/website/docs/guides/sl-snowflake-qs.md @@ -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: diff --git a/website/snippets/_sl-dbt-mesh-faq.md b/website/snippets/_sl-dbt-mesh-faq.md new file mode 100644 index 00000000000..1a517f1aa21 --- /dev/null +++ b/website/snippets/_sl-dbt-mesh-faq.md @@ -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: + + + +```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... +``` + + +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. +