learning-it by example

Back to the video

Data Vault 2.0: Hubs, Links and Satellites in SQL

Three loads into a tiny Data Vault in SQLite, and the third, a repeat, added 0 rows.

Video #262 ยท Data modelling

Steps in the video

  1. 0:00 Three loads into a tiny Data Vault. The third one added 0 rows.
  2. 0:34 The idea
  3. 1:09 Setup
  4. 1:30 Five tables
  5. 2:00 Hash keys, hubs and links
  6. 2:35 Satellites keep history
  7. 3:06 One load
  8. 3:21 A star made of views
  9. 3:38 Run the loads
  10. 4:47 What this does not show
  11. 5:26 Mistakes to avoid
  12. 5:52 My take and next steps
  13. 6:12 Recap

Files

  • run.py (55 lines)
  • source.py (11 lines)
  • vault.py (78 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

Five made-up orders in SQLite; no speed measured, and point-in-time tables, bridges, deletes and late data are not covered; the repeat load reuses the same load date; one load per date (a second change on the same load date is ignored)

Sources

Learning IT by Example.