Files
org_web/posts/career/airflow.org

3.9 KiB
Raw Blame History

Datamarts, Airflow and DAG's

#+DATE:<2025-11-15 Sat 18:37>

ADD THE ORCHESTRATOR DIAGRAM

ADD THE OVERALL DIAGRAM

What they are:

Summary from Filippo:

  • A DataMart it's simply a database that is made ad-hoc to contain a certain subset of data (Specific tables with specific columns).
  • Once that is created Airflow is used to put data in that database. So it extract data from other sources (APIS, databases) and loads it into the datamart we have created.
  • Once you get Airflow locally working and a new Datamart (deployed locally) you can then write a dag to load data into the Mart.

A data warehouse is where all the data is stored (sales, marketing, HR etc.). A data mart is just what one group needs, so for example, a finance data mart would contain invoices, payments and budgets data.

Apache Airflow

It is a tool that lets you automate and schedule data tasks. It:

  • Runs jobs on a schedule (e.g. every night at 1am).
  • Knows what needs to run before what.
  • Shows you a nice UI so you can see: what succeeded, what failed and where its stuck.

So: Airflow = a smart scheduler and organiser for data workflows.

DAG

DAG stands for directed acyclic graph. In simple terms, it is just a workflow made of tasks in a certain order. For example, a DAG can be: get_data, then clean_data, then load_data_into_datamart, and finally send_email. DAG is the whole workflow, the tasks are the individual steps inside the DAG.

ELT (Extract → Load → Transform)

Do the cleaning after loading into the warehouse. Flow:

  • Extract from source systems
  • Load raw data directly into the warehouse
  • Transform inside the warehouse (usually with SQL)

Here is a diagram that explains this process:

../../assets/sketchnotes/elt-yed.svg

Diagram

Sam has written the following and made this diagram

../../../assets/images/diagrams/airflow.png

  1. AZDO repo for our datamart to go in. Clone the data mart example template
  2. Datamart, can use one big one that has different tables for everything that we need.
  3. Local airflow that calls api and gets data. continuation tokens can be used. there is a good example
  4. Upload everything to microlise servers where it is run automatically
  5. Power bi, change data sources to be references to our sql. Can have all tables in power bi. Use filters

Summary that I wrote in slack: