Tutorial

Tutorial

Get Daana CLI running in 5 minutes and see results in 10 more.

What You'll Learn

ChapterTopicKey Concept
1. Jump StartMulti-source mergingTime-travel queries
2. Building BlocksModel, Mapping, WorkflowThe three pillars
3. Structuring LogicGrouped attributesAtomic concepts
4. Loading StrategiesFULL vs FULL_LOGHistory tracking
5. Mastering DMDLRelationshipsComplex models
6. ProductionDeploymentBest practices
7. Analytics LayerDimensions and factsPoint-in-time joins

Quick Setup (5 min)

Prerequisites

  • Docker: Install Docker Desktop, or some alternative such as OrbStack.
  • Terminal: Any terminal works, but we recommend an IDE with integrated terminal

Step 1: Install Daana CLI

Download the binary for your platform and install:

# Extract and install
tar -xzf daana-cli_*_<OS>_<ARCH>.tar.gz
sudo mv daana-cli /usr/local/bin/

# Verify it works
daana-cli --version

Note: If you don't have the download link, contact your Daana representative.

Step 2: Create Your Tutorial Project

# Create project with the quickstart example
daana-cli init my-tutorial --example quickstart
cd my-tutorial

This creates a project containing:

  • model.yaml - placeholder model; Chapter 1 replaces its contents with the Book Retailer entities
  • workflow.yaml - workflow configuration that references mappings/customer-mapping.yaml and mappings/order-mapping.yaml
  • connections.yaml - database connection profile pointing at the local PostgreSQL containers, plus commented-out examples for BigQuery, MSSQL, Oracle, and Snowflake
  • docker-compose.yml - local PostgreSQL containers
  • data/ - sample SQL data files
  • tutorial_setup.sh - data loading script specific to this tutorial
  • mappings/ - empty directory; Chapter 1 walks through generating and completing the mapping files
  • config.yaml - project-local CLI configuration

Step 3: Start Databases and Load Sample Data

./tutorial_setup.sh

The script starts the local PostgreSQL container, waits for it to accept connections, and loads the Book Retailer schema and sample data. It prints a single confirmation line:

Sample data loaded.

Step 4: Install Daana Framework

daana-cli install

This creates the internal tables Daana uses for orchestration.


You're Ready

The data and Docker environment are in place. Continue to Chapter 1: Jump Start to author model.yaml and the mappings, then deploy and execute the workflow.

Sample Data Overview

The Book Retailer dataset includes:

  • 10 customers across 12 source rows (customers 1 and 3 each have an extra status-change row in the CRM)
  • 275 address snapshots (daily snapshots showing customer moves)
  • 9 loyalty memberships with tier assignments (one customer has none)
  • 13 orders with monetary amounts and currency codes (three customers placed two orders each)

This small dataset demonstrates Daana's key features: multi-source merging, snapshot deduplication, grouped attributes, and time-travel queries.


When You've Completed the Tutorial

The local PostgreSQL container and named volume keep running until you stop them. Most readers leave the tutorial environment up to keep exploring. When you are done, run from the project directory:

docker-compose down -v

This stops the container and removes the named volume, freeing disk space. Re-running ./tutorial_setup.sh from the same directory recreates everything from scratch.


Troubleshooting

Docker not running?

  • macOS: Check menu bar for Docker icon
  • Windows: Check system tray for Docker icon
  • Linux: Run sudo systemctl start docker

daana-cli install says the framework is already installed? To start from a clean slate, run from the project directory:

docker-compose down -v
./tutorial_setup.sh

down -v removes the volume, and tutorial_setup.sh re-creates the container and reloads the sample data. After that, daana-cli install succeeds again.

Need help?