How mattermost/mattermost-data-warehouse works
Project type and purpose
• This is an ETL/ELT data-warehouse orchestration platform for Mattermost. It uses Airflow on Kubernetes to extract data from sources (S3, GitHub, Stripe, Salesforce, RudderStack, Snowflake raw tables, etc.), loads it into Snowflake staging, transforms it via two DBT projects (snowflake-dbt and mattermost-analytics), and exports processed data to downstream tools (Hightouch, Postgres, dashboards).
• Key goals: centralized orchestration (Airflow), robust transformations (DBT), role management (Snowflake roles), notifications (Mattermost), and utility scripts for edge-case ETL tasks.
File structure
• Top-level directories:
• airflow/ – Airflow DAGs, plugins (Mattermost hooks/operators), tests
• extract/ – Python scripts to pull data from S3 and APIs into Snowflake
• transform/ –
· snowflake-dbt/ – legacy DBT project of Snowflake models
· mattermost-analytics/ – new DBT project for analytics models (staging, intermediate, marts, reports)
· sql/ – standalone SQL scripts executed by DAGs (e.g., NPS feedback updates)
• load/ – Snowflake role definitions, Airflow DAG to apply permissions
• utils/ – Python CLI scripts for ad hoc ETL tasks and helpers (DB, GitHub, GeoLite, packets, etc.)
• Configuration & build artifacts: Dockerfiles, docker-compose yamls, Makefile, pyproject.toml, GitHub CI workflows
• Tests are co-located under airflow/tests/ and top-level tests/ and transform/mattermost-analytics/tests/
README for additional insights
• Describes a layered “Extract → Load → Transform → Export” architecture
• DBT runs on DBT Cloud, orchestrated via Airflow DAGs
• Environment variables drive Snowflake connections for different roles (SYSADMIN, LOADER, TRANSFORMER, PERMISSIONS)
• Utilities and billing/invoicing tasks are run as Airflow DAGs
• External systems: Kubernetes cluster, Snowflake, S3, DBT Cloud, Mattermost (for notifications), Hightouch, Postgres