Recipe Concept

The recipes correspond to dbt projects, an open-source data modeling tool by Fishtown Analytics. We heavily rely on dbt's resources properties and extend them in order for you to define your metrics and build a semantic layer on top of your data. For those who're not familiar with dbt, we have an embedded IDE that lets you create dbt models from your data but we strongly advise you to go through dbt's tutorials or at least learn the concept.

Introduction to Rakam for beginners

Once you create your first recipe, you can create your first model from your tables in your database. In dbt, we call them source.

In order to create a source, click the + Create dropdown in the sidebar, click the Create file button and select the tables that you're going to analyze. Once you import the tables, The IDE will create a dbt resource file that can be modified for your use case.

Introduction to Rakam for dbt users

If you're already using dbt, you can integrate Rakam to your dbt project connecting to your GIT repository. Click the Integrate your GIT repository button on Develop page and connect to your repository. Please note that if your repository is private, you need to add the generated SSH key into your repository for Rakam to be able to access your repository.

Once you connect to your repository, we will automatically synchronize your models, seeds, and sources. By default, we create dimensions for each column definitions in your resource files but since dbt doesn't provide any way to define metrics, we make use of the meta property as follows:

models:
 - name: customers
   columns:
     - name: country_code
       meta:
         rakam.dimension:
           type: string
     - name: city
       meta:
         rakam.dimension:
           type: string
     - name: total_customers
       description: total number of customers defined as count(*) in sql
       meta:
         rakam.measure:
    	    aggregation: sum

In addition to column mapping, you can also create custom measures and dimensions by defining them under meta or the model:

models:
  - name: customers
    meta:
      rakam:
         measures:
            total_rows:
               aggregation: count
         dimensions:
            full_location:
	            sql: CONCAT({{TABLE}}.country, {{TABLE}}.city)   
	            type: string

You can learn more about the data modeling concept in Creating Datasets ].