{"id":4353,"date":"2023-01-17T16:16:27","date_gmt":"2023-01-17T16:16:27","guid":{"rendered":"https:\/\/wearekemb.com\/?p=4353"},"modified":"2026-08-12T14:42:37","modified_gmt":"2026-08-12T14:42:37","slug":"model-synchronization-from-dbt-to-metabase-and-vice-versa","status":"publish","type":"post","link":"https:\/\/wearekemb.com\/en\/model-synchronization-from-dbt-to-metabase-and-vice-versa\/","title":{"rendered":"Model synchronization from dbt to Metabase and vice-versa"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Global documentation with local input<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In theory, the proper documentation of BI processes is as fundamental as the treatment of the data itself. However, in practice, the former is often overlooked because the priority is heavily placed on delivering results in the form of reports and dashboards. This is a common misconception, as a rich documentation can save time (and money) in future processes.&nbsp; In this article, we highlight the importance of the documentation of data architecture in business intelligence and also introduce a solution for model synchronization from dbt to Metabase which facilitates access to table relationships, model and column descriptions, semantic types, and exposures.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>\u201cThe broader the BI stack becomes, the more difficult it gets to keep track and to document the nuances along the pipeline process\u201d<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">The importance of data architecture documentation in business intelligence<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In short, the appropriate documentation of data architecture is important in business intelligence because it helps to ensure that the data being analyzed is accurate and reliable. This is essential for making informed business decisions based on the data. Therefore, having a clear understanding of the data structure allows users to know how the data is organized and how it can be accessed and used. This includes information about the data sources, the data model, and the relationships between different data elements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover, proper documentation helps to improve the maintainability of the BI system over time. It allows new users to quickly understand the data and how it is used. Furthermore, it helps to ensure that changes to the data structure are properly documented and communicated to all relevant stakeholders.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The challenges<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The broader the BI stack becomes, the more difficult it gets to keep track and to document the nuances along the pipeline process. This requires repetitive documentation in every step of the process, which ultimately compromises the quality of the documentation, or even its creation as a whole. Additionally, the pressure put on data analysts to produce results within tight deadlines often depletes all capacities again deprioritizing the documentation process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The solutions<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While the focus of current and new data tools has been put almost entirely on data processes rather than its documentation, it is no surprise that the latter is often overlooked. Fortunately, this is changing as more recent tools such as dbt (Data Build Tool) facilitates the creation and visualization of documentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">dbt stand alone documentation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>dbt docs generate<span>&nbsp;<\/span><\/strong>is a command in the dbt CLI (command-line interface) that generates documentation for your dbt project. In dbt cloud generating this documentation is equally straightforward (<a href=\"https:\/\/docs.getdbt.com\/docs\/collaborate\/build-and-view-your-docs\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/docs.getdbt.com\/docs\/collaborate\/build-and-view-your-docs<\/a>). This documentation includes information about your project\u2019s models, tests, and seed files, as well as the relationships between these elements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you run the dbt core<span>&nbsp;<\/span><strong>docs generate<\/strong><span>&nbsp;<\/span>command, dbt will create a docs\/ directory in your project, and within that directory, it will create Markdown files for each model, test, and seed file in your project. These Markdown files contain information about the SQL code in each file, as well as any comments or documentation you have written in your dbt project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">dbt core docs serve is another command in the dbt CLI that allows you to view the documentation that has been generated by the dbt core docs generate command. In dbt cloud your documentation is made available within the UI itself. When you run dbt core docs serve, dbt will start a local web server that serves the documentation for your project. You can then view the documentation by visiting the URL provided by dbt in your web browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both the dbt core docs generate and dbt core docs serve commands are useful for creating and viewing documentation for your dbt project, which can help you understand your project\u2019s structure and how it is built. They can also be helpful for others who are working on your project, as they provide a clear overview of the project\u2019s components and how they fit together.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong><em>\u201c<\/em><\/strong><em>The<span>&nbsp;<\/span><\/em><a href=\"https:\/\/pypi.org\/project\/dbt-metabase\/\" rel=\"nofollow noopener\" target=\"_blank\"><em>dbt-metabase package<\/em><\/a><em><span>&nbsp;<\/span>solves this problem by propagating table relationships, model and column descriptions as well as semantic types (e.g. currency, category, URL) from dbt to Metabase data models.&nbsp;<\/em><strong><em>\u201d<\/em><\/strong><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Metabase documentation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Metabase, a cloud-based data visualization tools with good self-service BI capabilities, offers a \u2018data reference\u2019 section where a collection of pages is organized by database, then tables in that database, and it is where information about tables and data types of columns can be found. Of note, each table or column will only contain a description if your admin wrote something in the Data Model section of the Admin Panel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The optimal solution: dbt-metabase synchronization<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As mentioned above, both dbt and Metabase allow for the insertion of tables\u2019 and columns\u2019 descriptions as well as information about the relationship between these items. Nonetheless, this process becomes repetitive when the same information has to be entered in both platforms, which again ends up being ignored or even forgotten.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The<span>&nbsp;<\/span><a href=\"https:\/\/pypi.org\/project\/dbt-metabase\/\" rel=\"nofollow noopener\" target=\"_blank\">dbt-metabase package<\/a><span>&nbsp;<\/span>solves this problem by propagating table relationships, model and column descriptions as well as semantic types (e.g. currency, category, URL) from dbt to Metabase data models. Moreover, dbt-metabase also facilitates the extraction of exposures from Metabase which demonstrates how dbt models are exposed in BI, which closes the loop between ELT, modeling, and consumption.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In a production environment, exposures can be graphically seen as the lineage upon \u2018dbt docs generate\u2019 after the dbt-metabase exposures command. This makes dbt docs a useful utility for introspecting the data model from source consumption with zero extra\/repeated human input.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"402\" src=\"https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-dag-exposures-768x402-1.webp\" alt=\"\" class=\"wp-image-19913\" srcset=\"https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-dag-exposures-768x402-1.webp 768w, https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-dag-exposures-768x402-1-300x157.webp 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Using the package<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The \u2018how-to\u2019 document is somewhat technical, and it can take a few trial-and-error iterations before you get the dbt-metabase synchronization to come to fruition. Below we highlight the challenges we came across, as well as the solutions that allowed the successful application of the package.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1.1 \u2013 set up the config file first<br>The easiest&nbsp; approach was to set up a<span>&nbsp;<\/span><strong>dbt-metabase config<span>&nbsp;<\/span><\/strong>file first and only then run the main commands (i.e.,<span>&nbsp;<\/span><strong>dbt-metabase models\/exposures<\/strong>).&nbsp; Using the<span>&nbsp;<\/span><strong>dbt-metabase config<\/strong><span>&nbsp;<\/span>command, you can enter an interactive configuration session where you can cache default selections for arguments. This creates a config.yml in ~\/.dbt-metabase. This is particularly useful for arguments which are repeated on every invocation like metabase_user, metabase_host, metabase_password, dbt_manifest_path, etc.&nbsp;<\/li>\n\n\n\n<li>1.2 \u2013 Metabase database name<br>Another important note to remember while setting up the config file, is that when entering \u2018metabase database name\u2019, this should be the name given to your database within metabase (see picture below) and NOT the name used in the source such as \u2018RAW\u2019 or \u2018REPORTING\u2019 (unless you named your metabase database as such). In the picture below, you can see where you can find the metabase database name.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"262\" src=\"https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-metabase-database-768x262-1.webp\" alt=\"\" class=\"wp-image-19914\" srcset=\"https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-metabase-database-768x262-1.webp 768w, https:\/\/wearekemb.com\/wp-content\/uploads\/2026\/07\/synchronisation-dbt-metabase-metabase-database-768x262-1-300x102.webp 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>2 \u2013 save the exposures file in the Model folder<br>Ensure the yml file created to store exposures is saved in the model folder, otherwise dbt will fail to display the exposures upon dbt docs generate command.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Overall,<\/strong><strong><span>&nbsp;<\/span><\/strong>documentation of data architecture is critical for the successful implementation and use of a business intelligence system, and it is an essential part of any BI project. This is why accessible documentation of the process from data source to report is so important, not only to keep track of data but also to easily describe how and where the data is being used. While both dbt and Metabase offer the possibility of describing tables, columns and relationships between these items, this means that valuable resources are being used to document the same work twice. This problem is solved with dbt-metabase, a package that propagates table relationships, model and column descriptions and semantic types (e.g. currency, category, URL) to your Metabase data model and extracts dbt model exposures from Metabase.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Useful links<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Dbt:<\/strong><span>&nbsp;<\/span><a href=\"https:\/\/www.getdbt.com\/\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/www.getdbt.com\/<\/a><br><strong>Metabase<\/strong>:<span>&nbsp;<\/span><a href=\"https:\/\/www.metabase.com\/\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/www.metabase.com\/<\/a><br><strong>Dbt-metabase synchronization<\/strong>:<span>&nbsp;<\/span><a href=\"https:\/\/pypi.org\/project\/dbt-metabase\/\" target=\"_blank\" rel=\"noopener nofollow\">https:\/\/pypi.org\/project\/dbt-metabase\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dbt-metabase propagates table relationships, data descriptions and semantic types to your Metabase data model and extracts dbt model exposures from Metabase.<\/p>\n","protected":false},"author":8,"featured_media":19272,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[59,65],"tags":[],"class_list":["post-4353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-intelligence-en","category-data-reporting-en"],"_links":{"self":[{"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/posts\/4353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/comments?post=4353"}],"version-history":[{"count":3,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/posts\/4353\/revisions"}],"predecessor-version":[{"id":20443,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/posts\/4353\/revisions\/20443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/media\/19272"}],"wp:attachment":[{"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/media?parent=4353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/categories?post=4353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wearekemb.com\/en\/wp-json\/wp\/v2\/tags?post=4353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}