Data Modeling
Late-arriving facts should be loaded into the fact table using the dimensional context that was true when the event happened. The practical rule is simple: declare the fact grain, keep the business event timestamp, and resolve each dimension surrogate key by finding the dimension row whose effective date range contains that event timestamp.
What late-arriving facts are
A late-arriving fact is a business event that reaches the warehouse after its event date. The event itself is not necessarily wrong or duplicated. It is delayed.
Common examples include a point-of-sale transaction uploaded after a store reconnects, a subscription event delivered after a webhook retry, a claim submitted days after service, or an offline mobile activity synced later.
The modeling problem is not just freshness. The problem is historical context. If a transaction happened on Monday but arrived on Friday, the fact should usually join to the customer, product, store, sales territory, plan, or account attributes that were valid on Monday.
If the load process uses Friday's dimension state, historical reports can shift in quiet ways. Revenue may be attributed to the wrong sales region. Orders may be assigned to a product category that did not exist yet. Customer status at purchase time may be overwritten by customer status at load time.
Why event-time context matters
Dimensional models separate facts from descriptive context. Facts hold measurements at a declared grain. Dimensions hold the descriptive attributes used to slice those measurements.
When dimensions track history, each business entity can have multiple dimension rows over time. A customer may move segments. A product may change category. A store may change region. The fact row needs the surrogate key for the dimension row that was valid at the time of the fact event.
The durable principle is this: the fact's business event time chooses the historical dimension row. The warehouse load time is useful operational metadata, but it should not decide business context for an event that already happened.
This is especially important for periodic reporting. If a late order from last month is loaded today, last month's metrics may need to change. That is acceptable if the event belongs to last month. It is not acceptable for that event to inherit today's customer or product attributes by accident.
Start by declaring the fact grain
Late-arriving fact handling depends on a clear fact table grain. Without a grain, the team cannot tell whether a delayed record is a new event, a correction, a duplicate, or an aggregate restatement.
For example, a fact table grain could be:
- One row per order line.
- One row per payment authorization attempt.
- One row per daily account balance snapshot.
- One row per shipment scan event.
Once the grain is explicit, the late-arriving fact process can answer three questions:
- What timestamp defines when this business event occurred?
- Which dimension natural keys are present on the event?
- Which dimension surrogate keys were effective at that event timestamp?
For transaction facts, the event timestamp is usually the transaction timestamp, order timestamp, service timestamp, or activity timestamp. For snapshot facts, the relevant date may be the snapshot date. The important point is to define it as part of the model, not infer it differently in each pipeline.
A dimensional schema for late-arriving facts
Consider a hypothetical retail model. The fact table records one row per order line. Customers and products are type 2 dimensions, meaning their history is represented as multiple rows with effective date ranges.
The order line may arrive late because store systems batch files overnight, retries occur, or an upstream system republishes delayed events. The fact table still records the order line at the time the customer bought the item.
The dimensions expose the fields needed for an event-time lookup: the business natural key, a surrogate key, an effective start timestamp, and an effective end timestamp. The fact loader uses the natural key from the event plus the event timestamp to find the right dimension row.
This schema keeps the business question stable: when reporting sales by customer tier or product category, the answer reflects the tier and category at the time of sale.
| Table | Grain | Important columns | Purpose |
|---|---|---|---|
| dim_customer | One row per customer version | customer_sk, customer_id, tier, effective_start_ts, effective_end_ts | Stores customer history for event-time customer context. |
| dim_product | One row per product version | product_sk, product_id, category, effective_start_ts, effective_end_ts | Stores product history for event-time product context. |
| fact_order_line | One row per order line | order_line_id, order_ts, load_ts, customer_sk, product_sk, quantity, sales_amount | Stores order measures with surrogate keys resolved using order_ts. |
The surrogate key lookup rule
The lookup rule for a late-arriving fact is:
For each dimension on the fact, find the dimension row where the natural key matches and the fact event timestamp falls within the dimension row's effective range.
In plain English, do not ask, “What does this customer look like today?” Ask, “What did this customer look like when this event happened?”
The typical condition is conceptually:
- The fact's customer natural key equals the dimension customer natural key.
- The fact's event timestamp is greater than or equal to the dimension row's effective start timestamp.
- The fact's event timestamp is less than the dimension row's effective end timestamp, or the end timestamp is open-ended.
The same pattern applies to product, account, store, employee, vendor, policy, plan, territory, or any other historized dimension referenced by the fact.
Boundary conventions matter. Choose one convention and apply it consistently. A common pattern is start-inclusive and end-exclusive: the row is valid from its start timestamp up to, but not including, its end timestamp. This prevents overlapping ownership at exact change times.
Use the fact event timestamp for business context. Use the load timestamp for pipeline observability. Do not let one silently substitute for the other.
Worked example: a delayed order line
Here is a clearly hypothetical example. An order line occurred on March 10 but was not loaded until March 15. Between those dates, both the customer and the product changed dimensional attributes.
The order event says customer C-100 bought product P-55 for 100.00 on March 10. The customer moved from the Silver tier to the Gold tier on March 12. The product moved from the Accessories category to the Premium Accessories category on March 14.
If the loader uses March 15 context, the order is reported as Gold and Premium Accessories. That is wrong for an event-time analysis. On March 10, the customer was Silver and the product was in Accessories.
The late-arriving fact should be loaded with the customer surrogate key and product surrogate key that were effective on March 10. The load date may still be stored separately for operational tracing, but it should not determine the business dimension context.
A late fact loaded with current dimension keys can look clean in row counts while still misclassifying historical revenue, volume, or customer behavior.
| Record | Natural key | Effective period or event time | Attribute or measure |
|---|---|---|---|
| Customer dimension version 1 | C-100 | Mar 1 through before Mar 12 | Tier = Silver, customer_sk = 501 |
| Customer dimension version 2 | C-100 | Mar 12 onward | Tier = Gold, customer_sk = 502 |
| Product dimension version 1 | P-55 | Feb 1 through before Mar 14 | Category = Accessories, product_sk = 801 |
| Product dimension version 2 | P-55 | Mar 14 onward | Category = Premium Accessories, product_sk = 802 |
| Late order line | C-100 and P-55 | Event time Mar 10, loaded Mar 15 | sales_amount = 100.00 |
Reconciled measures after loading the late fact
Late-arriving facts often change historical measures. That is expected. The point is to change them in the correct historical bucket.
In the hypothetical example, March 10 sales increase by 100.00. Sales for the Silver customer tier increase by 100.00. Sales for the Accessories category increase by 100.00. March 15 does not receive the sale merely because that is when the event arrived.
This distinction is the heart of reconciliation. There are at least two useful views of the same row:
- Business reporting view: measures are grouped by event date and event-time dimension context.
- Operations monitoring view: counts and amounts may be grouped by load date to understand pipeline latency and arrivals.
Both views can be valid, but they answer different questions. Mixing them creates confusing dashboards: revenue appears late, historical segments drift, and stakeholders cannot tell whether a change is a business correction or a pipeline artifact.
| Reporting question | Date basis | Dimension context | Result for the example |
|---|---|---|---|
| How much was sold on Mar 10? | Order event date | Customer and product rows effective on Mar 10 | Increase Mar 10 sales by 100.00. |
| How much arrived in the warehouse on Mar 15? | Load date | Operational arrival context | Increase Mar 15 loaded amount by 100.00 for monitoring, not sales attribution. |
| Which customer tier gets the sale? | Order event date | Customer row effective on Mar 10 | Silver receives 100.00. |
| Which product category gets the sale? | Order event date | Product row effective on Mar 10 | Accessories receives 100.00. |
| What would a current-row mistake do? | Load date or current lookup | Rows current on Mar 15 | Incorrectly assigns 100.00 to Gold and Premium Accessories. |
Late-arriving fact versus late-arriving dimension
A late-arriving fact is delayed measurement data. A late-arriving dimension is delayed descriptive context. They are related, but they are not the same problem.
With a late-arriving fact, the event arrives after it happened, but the dimension history may already exist. The main task is to look up the correct historical dimension row by event time.
With a late-arriving dimension, the descriptive row needed for a fact may not exist yet, or a new historical dimension version may arrive after facts have already been loaded. That can require placeholder handling, inferred members, or later restatement. Those are separate modeling choices.
In practice, both conditions can happen together. A delayed order may reference a customer whose historical dimension row is also delayed. Keep the problems separate in the design: one question is how to date the fact, and the other is how to resolve missing or revised dimension context.
A practical load pattern
A robust late-arriving fact load does not need to be complicated, but it does need to be explicit.
- Stage the raw event. Preserve the natural keys, event timestamp, measures, source event identifier, and arrival timestamp.
- Deduplicate at the declared grain. Use the source event identifier or a stable business key appropriate to the fact grain.
- Resolve dimension surrogate keys by event timestamp. Join each dimension using natural key and effective date range.
- Insert or merge the fact at the declared grain. Do not create a second fact row just because the event arrived late.
- Recompute or incrementally update affected reporting periods. The affected period is based on event date, not load date.
- Validate reconciliations. Compare staged event counts and amounts to loaded fact counts and amounts by event date, arrival date, and resolution status.
The exact SQL, orchestration, and merge strategy depend on the platform. The modeling rule does not: event-time facts need event-time dimension keys.
Validation checks that catch wrong context
Late-arriving facts can be technically loaded and still be analytically wrong. Validation should check whether the row landed in the correct business period and the correct dimension context.
Useful checks include:
- Event date versus load date distribution: count facts by days late so unusual delays are visible.
- Dimension lookup coverage: count facts where a dimension natural key did not resolve to exactly one effective row.
- Effective date boundary checks: verify that each fact event timestamp falls within the chosen dimension row's effective range.
- Historical period restatement check: identify which prior dates, weeks, or months changed after the late load.
- Measure reconciliation: compare staged amounts to fact table amounts for the event dates touched by the load.
- Current-row mistake check: sample late facts and confirm they did not all receive the current dimension row by default.
The last check is simple but valuable. If every late fact gets the current customer row, the pipeline may be using a current-state lookup instead of an effective-dated lookup.
For every late-arriving fact load, reconcile both event-date measures and load-date arrivals. Those two views should be intentionally different, not accidentally mixed.
Common failure modes
The most common late-arriving fact failure is using load time as if it were event time. This usually happens because current-state dimension tables are easier to join than historized dimensions.
Other common failures include:
- Ambiguous fact grain: the loader cannot safely deduplicate or merge delayed records.
- Missing event timestamp: the pipeline only knows when the record arrived, not when the event happened.
- Overlapping dimension effective ranges: one fact matches multiple dimension rows.
- Gaps in dimension effective ranges: one fact matches no dimension row even though the natural key exists.
- Current attribute shortcuts: reports join facts to the latest dimension attributes instead of the stored surrogate keys.
- Uncontrolled restatement: historical metrics change without an explanation of which event dates were affected.
Most of these are design problems before they are tooling problems. Better orchestration can retry a load, but it cannot infer the correct historical context if the model does not preserve event time and effective dimension history.
Operator decision rules
Use these rules when designing or reviewing a late-arriving fact process.
- If the business asks when the event happened, use event date. Sales, usage, claims, shipments, and transactions usually belong to the date of occurrence.
- If the business asks when the system learned about it, use arrival or load date. Pipeline monitoring, operational latency, and source completeness often belong to the date of ingestion.
- If a dimension tracks history, resolve by effective date range. Do not join delayed facts to current dimension rows unless the business explicitly wants current-state reporting.
- If a delayed fact changes a closed reporting period, make the restatement visible. The number can change for a valid reason, but users need to know why.
- If dimension history is incomplete, do not silently guess. Mark the unresolved condition or route it through a defined remediation process rather than inventing context.
These rules help separate business truth from processing timing. A delayed event should not lose its original business meaning just because the warehouse learned about it later.
Key takeaways
- Late-arriving facts are delayed business events; they should usually be analyzed by when they happened, not when they loaded.
- The fact event timestamp must drive the lookup to historized dimension rows.
- A clear fact grain is required before you can safely deduplicate, merge, or restate delayed events.
- Store or preserve load timing for pipeline observability, but do not use it as business context unless the question is about ingestion.
- Reconcile late-arriving loads by event date, load date, dimension lookup coverage, and affected historical periods.
Next step
Pick one fact table that receives delayed events. Write down its grain, event timestamp, natural keys, and historized dimensions. Then sample ten late records and verify that each stored surrogate key points to the dimension row effective at the event timestamp.
- Read Unknown Dimension Members in Fact Loading: How to keep valid fact rows usable while making missing dimensional context explicit and measurable.
- Read Fact Table Audit Columns: Lineage Without Business Confusion: A practical guide to recording source lineage and load metadata while keeping business dimensions clean.
- Read Effective Time Versus Recorded Time: Know When a Fact Was True: A practical guide to separating business validity from system knowledge in data models and reports.