Core Concepts
Understanding the fundamental concepts behind Interlace.
Overview
Interlace is built around a few key concepts:
- Models - The fundamental unit of transformation
- Materialization - How model results are persisted
- Strategies - Patterns for updating materialised data
- Dependencies - How models relate to each other
The @model Decorator
Everything in Interlace revolves around the @model decorator:
@model(
name="my_model", # Unique identifier
materialise="table", # How to persist (table, view, ephemeral, none)
strategy="merge_by_key", # How to update (replace, append, merge_by_key, scd_type_2, none)
primary_key=["id"], # For merge/SCD strategies
schema_mode="safe", # Schema evolution mode
)
def my_model(dependency: ibis.Table) -> ibis.Table:
return dependency.filter(...) Execution Flow
When you run interlace run:
- Discovery - Interlace scans for Python
@modeldecorators and SQL files - Graph Building - Dependencies are resolved and a DAG is constructed
- Execution - Models run in parallel where possible, respecting dependencies
- Materialization - Results are persisted according to each model’s configuration
- Quality Checks - Post-materialisation checks validate output data
- State Tracking - Execution results, schema changes, and file hashes are stored
Learn More
- Models - Deep dive into model definitions
- Materialization - Persistence options
- Strategies - Update patterns (including SCD Type 2)
- Dependencies - How models connect