Skip to main content

Dynamic Development/Production environment

Coming Soon

This feature is under development and will be coming soon!

Introduction

Dynamic Development/Production environment

In a typical development workflow, you will have multiple environments

  • Production Environment: is the most stable environment where your End-users consume the Dashboards
  • Development Environment(s): isolated environment for your Data Analysts to develop and test their changes
  • (Optional) Staging Environment: is the environment where all of the work of your Data Analysts are merged together for the final review before publishing to Production

In this process, you might have multiple Data Sources (or Schemas) for each Environments

  • When you’re in Production Environment, all of your Dashboards (with Models + Datasets) point to the Production Data Source (or Schema).
  • When you’re in Development Environment, all of your Dashboards (with Models + Datasets) point to the Development Data Source (or Schema)
    • You might have multiple Development Data Sources (or Schemas) for your Data Analysts
  • When you’re in Staging Environment, all of your Dashboards (with Models + Datasets) point to the Staging Data Source (or Schema).

High-level Solution

Each branch of your Holistics project will have its own environment definition. This setup allows you to establish environment variables that dynamically adjust based on the relevant branch. Importantly, this environment file will not be checked into Git; it will be added to .gitignore.

This approach is similar to using an .env file in software development, allowing you to freely add any key-value pairs to your environment file.

dynamic-dev-prod-setup

Detailed Setup

For example, let’s say you have 1 production schema and multiple dev schemas for your analysts.

  1. Define the Environment Variables and their Values in the Environment File

    • File environment in dev_branch_a
      // Branch: dev_a
      // File: .env
      const ENV_SCHEMA = 'dev_a'
      const ENV_DATASOURCE = 'dev_warehouse'
      const ANY_OTHER_KEY_THAT_YOU_LIKE = 'foobar'
    • File environment in dev_branch_b
      // Branch: dev_b
      // File: .env
      const ENV_SCHEMA = 'dev_b'
      const ENV_DATASOURCE = 'dev_warehouse'
    • File environment in production branch
      // Env file of branch production
      const ENV_SCHEMA = 'prod'
      const ENV_DATASOURCE = 'prod_warehouse'
  2. Inject that Variables into your Model and Dataset file accordingly

    // Model file
    Model revenue {
    data_source_name: ENV_DATASOURCE
    table_name: '${ENV_SCHEMA}.revenue'
    }

When you switch to a different branch, or merge your change to the main branch to deploy, Holistics automatically picks the correct environment file and applies it.


Let us know what you think about this document :)