Active Data Warehouse Evolution

Context: FIT3003_MOC · Active Data Warehousing keeps the data current; this note handles the design changing underneath it — from the warehouse’s own requirements (§2–§5) or from the operational source (§6) · reuses Levels of Aggregation, Combining Star Schemas, Multi-Input Operational Databases Parent Framework: Active Data Warehousing

Quick Revision

  • 🎯 Objective: an active warehouse is time-boundless, so its requirements and sources drift ➔ for any change, name the level it enters, whether it propagates upward, and which dimensions, TempFacts, facts and triggers must be rebuilt.
  • 📦 Core Components: warehouse schema evolution ➔ change propagates up · change stays local · insert a star · delete a star | operational database evolution ➔ table structure · E/R schema · whole system replaced, each met by Option 1 update the existing stars or Option 2 build new ones.
  • ⚡ Key Constraint: propagation follows build dependency, not level number ➔ an upper star is hit only if one of its objects is built from the changed one; a dimension sourced straight from the operational table, or a star nothing is built from, stops the ripple.

📝 How It Works

1. The dependency map — draw it first

  • Level-0 fact ⟵ LabActivities Student (operational).
  • Level-1 dimensions (SemesterYearDIM, TimePeriodDIM) ⟵ LabActivities directly, not a lower star.
  • Level-1 TempFact ⟵ the Level-0 fact; Level-1 fact ⟵ its TempFact.
  • Level-2 fact ⟵ a view over the Level-1 fact; Level-2 dimensions reused from Level-1.
  • Method ➔ find the changed object, follow every arrow leaving it; whatever is reached must change, whatever is not is safe.

2. Change propagating to upper levels — Semester gains Year

  • Requirement ➔ Semester holds no Year, so analysis is by semester alone; add Year ➔ one record per semester per year.
  • Level-0 ➔ no change: Semester first appears at Level-1.
  • Level-1 dimension ➔ becomes , built once from distinct LoginDate, then maintained by trigger AddSemesterYear on LabActivities — find-or-insert, because every half-year brings a new member.
  • Level-1 TempFact and fact ➔ rebuilt on SemYearID = Year || Semester; the fact’s increment trigger must be find-or-insert, since every new semester opens key combinations with no fact row yet.
  • Level-2 ➔ the view is re-declared on SemYearID — propagation is “more at the schema design level than at the technical implementation level”.

3. Change not affecting upper levels — ComputerDIM added to Level-0

  • Level-0 ➔ the fact gains ComputerID (in the group by, with an FK), and its insert trigger must carry :new.ComputerID.
  • Level-1 / Level-2 ➔ untouched: their granularity is already reduced to semester and time period, so a computer axis has no place there.

4. Inserting a new star — Sub-Level-1 at Month × Hour

  • Why ➔ the jump from Login Date/Time to Semester Year/Time Period is wide; a star at month and hour sits between them.
  • Dimensions ➔ MonthDIM built and maintained by trigger AddMonthYear (find-or-insert on YYYYMM); HourDIM created once with all hours ➔ never maintained; DegreeDIM, StudentDIM reused from Level-0.
  • Fact ➔ a view over the Level-0 fact ➔ no trigger.
  • Impact above ➔ none: Level-1 dimensions come from LabActivities, its TempFact from Level-0, Level-2 from Level-1 — nothing is built from the new star.

5. Deleting a star — remove Level-1

  • Dimensions ➔ kept: Level-2 shares three of them.
  • Fact ➔ only the Level-1 fact goes — but the Level-2 fact is a view over it, so Level-2 loses its source and must be rebuilt from what survives.

6. Operational database evolution

  • Table structure ➔ LogoutTime is now recorded ➔ new measure Total_Duration. Option 1: alter table ComputerLabFactLevel0 add Total_Duration date; and the insert trigger stores :new.LogoutTime - :new.LoginTime — new records only, old ones have no logout time; upper levels follow the same way. Option 2: build a new warehouse, justified when the star “now has new requirements”.
  • E/R schema ➔ new entities ROOM (via COMPUTER.RoomNumber) and SOFTWAREACCESS–SOFTWARE off LABACTIVITIES ➔ two Level-0s: 0a at login grain ( absorbs RoomNumber, BuildingNumber; measures Num_of_Logins, Total_Duration) and 0b at software-access grain (; measure Total_Accesses). Each needs its own trigger; changes then propagate upward.
  • Whole system replaced ➔ the new lab system has no Degree entity; degree now lives in a separate Student Enrolment database as — a student’s degree is recorded per semester. Option 1: keep the star; the fact trigger fetches DegreeCode from StudentEnrolmentDatabase.Enrolment matching StudentNo and the login’s SemYearID. Option 2: one star per source — (lab: LoginDate, LoginTime, StudentNo, ComputerID) and — then merge into a final fact, kept current by a trigger on 0a ➔ Combining Star Schemas.

⚙️ Core Implementation

🔹 A maintained dimension — SemesterYearDIM

🔹 A new star as a view — Sub-Level-1

🔹 E/R change — Level-0b at software-access grain

🔹 Option 2 merge — degree from the enrolment star

⚖️ Core Decision Matrix

ChangeEnters atPropagates up?What is rebuilt
Year added to SemesterLevel-1 dimension✅ to Level-2SemesterYearDIM trigger; TempFact, fact, find-or-insert trigger; Level-2 view re-declared
ComputerDIM addedLevel-0 fact❌ — Level-1 is already coarserLevel-0 column, FK, trigger
Sub-Level-1 inserteda new star❌ — nothing is built from itMonthDIM trigger, static HourDIM, fact view
Level-1 deletedLevel-1 fact✅ — the Level-2 view loses its sourceLevel-2 fact re-sourced; shared dimensions kept
LogoutTime recordedLevel-0 measure✅ (Option 1)Total_Duration column trigger, then upper levels
New entities in the E/Ra second Level-0✅Level-0b fact trigger, then upper levels
Operational system replacedevery source lookup✅Option 1: re-point the trigger’s lookup · Option 2: two stars merge trigger on 0a

When It Flips: a change between two levels propagates only when an existing star is built from the changed object — Sub-Level-1 sits between Level-0 and Level-1 yet touches nothing, while a dimension change at Level-1 reaches Level-2 through its view.

🧠 Active Recall