Data Warehousing track
End-to-End Data Warehouse on Linux + Docker: SQL Server 2022 + Airflow
You will build SBEcoLTDDW, a sales data warehouse, from an operational database all the way to reporting views. SQL Server 2022, running in a Docker container on an Ubuntu Linux VM in AWS, stores and transforms the data. Apache Airflow, also in Docker containers on the same VM, only decides what runs when: every task is one SQL file kept in its own folder, so you can read, test and change the SQL without touching Python.
Infrastructure: Linux + Docker + SQL Server on Linux
The lab is one Ubuntu Linux virtual machine deployed in AWS. Docker runs every service in a container: SQL Server 2022 for Linux in one, Apache Airflow in six more. Your PC only edits files, opens SSH sessions and a browser.
Deployment: from the PC into the containers
Nothing is installed by hand inside a container. Files are edited on the PC, copied to the Linux server, and reach the containers either through bind mounts (Airflow) or through docker exec / docker cp (SQL Server).
- Copy the lab to the Linux server.
scpputs the master copy from the PC into~/sbecoltddw; shell scripts get their line endings converted to LF. - Build the warehouse objects.
run_sbecoltddw.shpipes each course SQL file intosqlcmdinside the SQL Server Linux container withdocker exec. There is no SQL Server client installed on the host. - Reset the source when replaying.
reset_source.shpipes SQL intosqlcmdinside the container to undo the simulator's changes in AdventureWorks2022, so the scenarios of Chapter 12 can be run again from the original data. - Install the pipeline into Airflow.
setup_airflow_sbecoltddw.shinstalls compose Version11, copies DAGs, plugin and SQL into~/airflow, recreates the Airflow containers once, and creates the connection. - Bind mounts make them live. The containers see
~/airflow/{dags,plugins,sql}as/opt/airflow/…; the scheduler picks up the DAGs within seconds. - Run. Every task opens an ODBC connection from the Airflow worker container to
mssql:1433and runs one SQL file in SBEcoLTDDW.
The whole pipeline in one line
Where this comes from
The warehouse design follows the LinkedIn Learning course Implementing a Data Warehouse with SQL Server 2022 (schemas, the Date/Customer/Orders star, the indexed view, columnstore and workload classification). This tutorial runs those exercises on SQL Server for Linux, fixes what breaks there, and wraps them in a production-style pipeline.
Chapters
What you will have at the end
| Piece | What it is | Where |
|---|---|---|
| DWSBEcoLTDDW | Star schema with an SCD2 customer dimension, an incremental fact table, two indexed views and a columnstore index | SQL Server 2022 container labenv_mssql_1 |
AFsbecoltddw_e2e_pipeline | 26-task Airflow DAG in 6 task groups, orchestration only | ~/airflow/dags |
AFsbecoltddw_source_changes | A source-system simulator: customer moves, new orders, a bad order and its fix | ~/airflow/dags |
| SQL31 SQL files | Deploy, extract, check, load, maintain, DQ and publish steps, one batch each | ~/airflow/sql/sbecoltddw |
PYMsSqlFileOperator | ~120 lines of plumbing that run a SQL file and log its output | ~/airflow/plugins |
All of the code is in this site's code folder; Appendix A lists every file.