Batch Analytics Warehouse with Apache Airflow 3 and dbt: Dimensional Models, History, Late Data and Safe Backfills

Build a batch analytics warehouse that survives late data, reruns and bad releases. Apache Airflow 3 loads a shop database, a rate-limited payments API and daily files one UTC business day at a time, idempotently; partitioned assets start each build when all sources have announced a day. dbt Core builds a star schema with type 2 history from raw, microbatch facts that replace exactly the days a late refund touches, contracts and tests in an audit schema, reconciliation against the provider's settlement, and publishing in one transaction.

Data Engineer. Advanced.

What you will build and explain

  • Load a business day from a database, a paginated rate-limited API and file drops idempotently, so any day can be run again with identical checksums.
  • Schedule a warehouse by data with Airflow 3 partitioned assets, and rebuild exactly the days a late commit or late refund changed.
  • Model a star schema with stable surrogate keys and type 2 dimensions derived from raw history, joined point in time, with inferred members for late customers.
  • Build late-arriving facts with dbt microbatch models that replace whole days, and backfill a year under concurrency limits without double counting.
  • Gate publication with contracts, data and unit tests and reconciliation against an outside system, using write-audit-publish in one transaction.
  • Operate the warehouse: CI against production state, freshness and deadline alerts, recovery from outages and restarts, and erasure requests that stay erased.

Before you begin

  • Writing SQL with joins, GROUP BY, common table expressions and simple window functions; reading and writing small Python modules and running pytest. Airflow, dbt, dimensional modelling, late data and warehouse operations are taught from the beginning
  • Using a terminal and Git, running a Docker Compose stack (starting it, reading logs, opening a shell in a container), and reading JSON and YAML
  • A Linux or macOS computer, or Windows with WSL 2, with Docker and Compose 2.20 or later, 8 GB of memory for Docker, about 25 GB of free disk, and internet access for the first setup

Who this is for

For data engineers and analytics engineers who write SQL with joins and window functions, read Python and run Docker Compose, and now own a warehouse others decide with: idempotent daily loads from a database, an API and files, Airflow 3 scheduling by data, type 2 history, late refunds applied to the right days, safe backfills and publication gated on tests and reconciliation.

Curriculum

Learning topics (14)
  1. Check your starting skills and prepare your machine

    This project is for a data engineer, or an analytics engineer moving into data engineering, who has written SQL for reports and scheduled a script or two, and now has to own a warehouse that other people make decisions with. A warehouse like that has to survive things a nightly script never meets: a day loaded twice, a refund that arrives two weeks late, a price that changed last Tuesday, a supplier who renames a column, a model change that looks right and books revenue on th

  2. Follow one business day from three sources to a published mart

    Quillfield Grocery's warehouse takes each business day's orders, payments and catalogue, loads them so that any day can be loaded again with the same result, models them into a star schema that remembers how customers and products looked on the day of each sale, applies late payment events to the days they belong to, and publishes a day only after it has passed its tests and matched the payment provider's settlement report.

  3. Understand Airflow 3's components, Dags, runs and logical dates

    Quillfield's old pipeline was a cron entry that ran a script at 02:00. When the script failed, nobody knew until finance asked; when it was slow, the next night's run started on top of it; when someone needed last Tuesday again, they edited a date in the script. Apache Airflow replaces the cron entry with a scheduler that knows what each run is for, what it depends on, how often to retry it, how many may run at once, and when it is late.

  4. Load any day again from a database, an API and files with the same result

    The week Quillfield counted twice began with a sensible action: after an outage, someone re-ran the nightly job for the days that had partly loaded. The job appended rows, so every row that had loaded the first time loaded again. A load that can be run twice with the same result is idempotent, and every other property of the warehouse rests on it: retries, backfills, late corrections and recovery all mean "run that day again".

  5. Schedule work by data and by business day, not by clock alone

    The old nightly job ran at 02:00 whether or not the data was there. On the morning the catalogue file arrived at 03:10, it built margin from yesterday's catalogue; on the morning everything was in by 00:30, finance still waited until 02:00. And when refunds for last week arrived, nothing ran at all, because the clock had no idea a past day had changed.

  6. Design facts, dimensions and grain for questions people ask

    Quillfield's old reporting database had one wide table per report. Finance's table, the category managers' table and the stock team's table each joined orders to whatever they needed, each in its own way, so the three answered "how much did we sell in Calloway last Tuesday?" with three different numbers. A dimensional model fixes the shape once: a few fact tables that record what happened, at a stated level of detail, and dimension tables that describe who, what, where and wh

  7. Keep every customer and product version and join each sale to the one in force

    Quillfield's category managers asked for margin by product at the cost on the day of each sale. The old reporting database held only today's catalogue, so a supplier's price rise on 1 March rewrote the margin of every sale before it. The same happened to customers: a customer who moved from Ashmere to Calloway took all their past orders with them, and the city reports drifted every time someone moved.

  8. Apply late refunds to the right days with microbatch models

    October's revenue was 2.3 per cent above what Paylark paid Quillfield. The nightly job was not wrong about any single day when it ran: it counted every refund it could see. But a refund for 3 October that Paylark listed on 12 October belongs to 3 October, and by then the job only ever looked at 11 October. This lesson follows a late refund from the moment Paylark lists it to the moment 3 October's revenue is republished, and rebuilds exactly that day and nothing else.

  9. Test, contract and publish only data that passed

    A dashboard that is wrong for an hour does more damage than one that is late for an hour: people act on it. Quillfield's stock team once ordered against a week of doubled sales. The warehouse therefore never builds in place. It builds every run into a separate schema, tests it there, compares it with the systems of record, and only then replaces what readers see, in one transaction. A failure at any step leaves the published data exactly as it was.

  10. Rebuild a year or a week without double counting

    The week Quillfield counted twice was a recovery done by hand: someone re-ran a job for a range of days, and the job appended. This lesson does the same kinds of recovery on purpose and safely: loading a year of history the first time, reprocessing sixty days that already loaded, surviving a scheduler restart in the middle, and rebuilding exactly the days a bad release touched.

  11. Test changed models against production state before they ship

    A model change reaches finance's dashboard through one path: it is merged, released, and the next build runs it. Continuous integration is where it is checked before that, and the checks are only useful if they are cheap enough to run on every change and close enough to production to catch what production would. This lesson builds Quillfield's CI for the dbt project and the Dags, shows which change it builds, and runs a release that passes all of it and is still wrong.

  12. Watch freshness, reconcile revenue and answer an erasure request

    A warehouse is operated by the questions people ask it before 09:00: is yesterday there, is it right, and if not, why not and when will it be. This lesson sets up the signals that answer those questions without anyone opening Airflow, rehearses a provider outage past the morning deadline, and handles a customer's request to be erased.

  13. Build, backfill, operate and drill the warehouse

    This runbook builds Quillfield's warehouse on your computer, loads a year of history, runs a day the normal way, and then takes the warehouse through every drill, in order. Each step says what to run, what you should see, and how to check it before going on. Outputs come from the author's run on an m7g.4xlarge Linux host (16 CPUs, 64 GB); on a laptop the long steps take longer, and your dates and counts differ because the history ends on the day before you start.

  14. Remove the lab and confirm nothing remains

    The lab runs entirely on your computer, so cleaning up costs nothing and has no deadline, but its databases, images and generated secrets take about 10 GB of disk until you remove them. Everything the lab creates carries the label quillfield.lab=warehouse or one of two exact image names, and the cleanup removes only those.

Practical build steps (17)
  1. Prepare your computer

    Check that Docker, Compose, memory, disk and ports are ready for the lab before anything starts.

  2. Bring the lab up

    Generate the secrets, build the images, start the databases, Paylark, Airflow and monitoring, and generate a year of Quillfield's history.

  3. Load a year of history

    Backfill the three ingestion Dags for a year without announcing days, check every day arrived, and build and publish the year once.

  4. Run yesterday the normal way

    Run yesterday through the three ingestion Dags and watch warehouse_day start only when all three have announced it.

  5. Load a day twice and commit an order late

    Load a day twice and compare checksums, then commit an order dated three days ago and watch the correction rebuild that day.

  6. Load payments while Paylark misbehaves

    Turn on rate limits, server errors and duplicated pages, load four days of payments, and check that every event arrived exactly once.

  7. Watch a deferred sensor and a refused file

    Start a catalogue load before its file exists, then drop the file; then load a file whose field was renamed and put it right.

  8. Apply late refunds to their own days

    List forty refunds for days up to two weeks back and watch exactly those days rebuilt and reconciled.

  9. A customer who arrives after their order

    Place an order for a customer the shop has not saved, then save the customer, and see the fact row pick up the real attributes.

  10. A broken row and a missing event

    Break a day with a negative quantity, then remove a charge from another day, and see each refused before publication.

  11. Run CI on a changed model

    Run the full CI, then change one staging model and see only it and its descendants built against production.

  12. A release that passes CI and is wrong

    Release a model that books payments by India time, see CI pass and reconciliation refuse it, then revert and rebuild those days.

  13. A Paylark outage past the deadline

    Make Paylark answer 503 for fifteen minutes during a day's run and watch the deadline alert fire and the day recover by itself.

  14. Reprocess sixty days

    Run sixty loaded days again with reprocessing and rebuild them, and confirm nothing changed.

  15. Answer an erasure request

    Erase one customer's personal fields and check that they are gone and stay gone.

  16. Read the metrics, alerts and report

    Read the dashboard and the alerts the drills left, and save a report for the record.

  17. Remove the lab

    Remove every container, volume, network, built image and generated secret of the lab, and confirm nothing is left.

Access

Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.

Cloud costs and boundaries

No cloud account, licence or spending is needed: Quillfield's shop, the fictional Paylark API, the warehouse, Airflow, Prometheus and Grafana all run as containers on your own computer, with a fictional company, customers and payments generated by the project. The first setup downloads container images and Python packages.

Licence and completion

Vectametric Project Source Licence (2026-09-27): lawfully obtained source may be copied, modified and deployed for personal learning and interview preparation, including personal portfolio demonstrations with attribution. These permissions continue after online access expires. Do not resell or redistribute the Source Pack or its original source files, unchanged or modified. Commercial or client production use requires separate written permission. Third-party components, such as Apache Airflow, dbt Core, dbt-postgres, SQLFluff, PostgreSQL, Prometheus, the StatsD exporter and Grafana, retain their own licences and terms. See LICENSE.txt and the Project Source Licence section of the site Terms for the full rules.

Questions about projects

Do I need a cloud account?

You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.

Can I read the code with Learning Access?

Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.

Are cloud charges included?

No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.

Does the project include troubleshooting and interview preparation?

The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.

How long can I use the project?

The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.

Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy