Quick summary:

Bitemporal SCD Type 2 tracks business time and system time, so you can reproduce exactly what a past report showed. This composite case comes from our lending engagements. A regulator asked about one borrower’s risk tier on March 31, and about what the March 31 report said. The lender’s SCD Type 2 dimension could hold only one answer. Our team rebuilt that dimension with Databricks AUTO CDC (formerly APPLY CHANGES). Late corrections now fix business history without erasing what earlier reports showed. Any report filed since recording began can be reproduced with one as-of query. Because the feature was still in Beta as of November 2026, we validated it hard and kept a fallback.

Do your auditors keep asking why a filed report disagrees with today’s dashboard? If your dimension table can show only one version of the past, the problem is almost certainly a single timeline. Standard slowly changing dimensions keep one pair of dates, so they can record when a value changed or when your platform found out, but not both. The composite case below, drawn from ScriptsHub Technologies’ consumer-lending compliance work, shows those symptoms and how a second timeline fixed them.

Why can’t standard SCD Type 2 explain a filed report?

Because a standard history table stores one timeline, and an audit trail needs two.

The borrower dimension tracked risk tier and KYC status with the usual start date, end date, and current-row flag. In early April, a credit review downgraded one borrower from tier B to tier C, effective March 20. The review reached the warehouse on April 3. The quarterly regulatory report for March 31 had already been generated on April 1, showing tier B.

Months later the examiner asked about that borrower. The dimension said tier C from April 3, because the load used its own run date as the start date. The credit file said March 20. An engineer backdated the row to match the credit file, which made the history correct and the filed report impossible to explain. The dimension now claimed the borrower was tier C on March 31, yet the report said B.

Both versions were right. March 20 is when the downgrade became true, and April 3 is when the platform learned about it. One pair of dates cannot hold both facts, so every fix to one answer broke the other. Closing that gap is what bitemporal SCD Type 2 is for. The same arrival-time trap appears in incremental pipelines, as our guide to late-arriving data and watermarks explains.

What is bitemporal SCD Type 2?

A bitemporal dimension is an SCD Type 2 history that records every version of a row on two independent timelines: business time and system time.

Business time says when a value was true in the real world. System time says when your platform recorded that belief. Martin Fowler’s essay on bitemporal history describes the same split as actual time versus record time. The Wikipedia overview of bitemporal data modeling traces the idea to temporal databases. A classic slowly changing dimension Type 2 table keeps only the first axis.

With bitemporal data, the same rows answer two questions. What was true on March 31, and what did we believe on April 1 about March 31? A correction never overwrites a business value. Instead, the engine closes the old belief and opens a new one, so the earlier version stays queryable.

Databricks now ships this as a storage mode of its AUTO CDC (change data capture) API. Bitemporal AUTO CDC in Azure Databricks adds four system-managed columns to the target table. Business time lives in __START_AT and __END_AT, and system time in __SYSTEM_START_AT and __SYSTEM_END_AT. A null end value means “still valid” on that axis. Table 1 shows our borrower after the late credit review.

Bitemporal SCD Type 2 in Databricks AUTO CDC: one row keeps the old belief, two rows hold corrected tier B and C history

Table 1: One borrower in the bitemporal dimension after the late credit review. Row 1 is what the April 1 report saw.

Vocabulary varies by source. Business time is also called valid, effective, or application time, the last being the SQL:2011 temporal standard term. System time is also called transaction, record, or technical time. Some teams call the whole pattern bi-temporal or dual SCD2. Table 2 maps the generic column names to the ones Databricks generates, and Table 3 compares the two models.

Bitemporal Databricks AUTO CDC: business (valid) time in __START_AT/__END_AT, system (transaction) time in _SYSTEM*

Table 2: Bitemporal terminology mapped from common usage to Databricks AUTO CDC columns.

 

Standard vs bitemporal SCD Type 2: one timeline vs business and system time; only bitemporal reproduces past reports

Table 3: Standard SCD Type 2 compared with bitemporal SCD Type 2.

 

When do you need a second timeline?

You need bitemporal SCD Type 2 whenever someone will ask what your data said at a past moment, especially after a backdated change.

The pattern appears wherever effective dates and arrival dates drift apart. Insurers backdate policy endorsements, payroll teams apply retroactive raises after a pay run closes, and healthcare claims are adjusted months after the service date. In each case one group needs the corrected truth while another has to defend a number that already went out.

A machine learning model trained in June should be reproducible in December from the exact rows it saw. A single timeline cannot guarantee that once late corrections land. If nobody will ever be asked to reproduce a past report, standard SCD Type 2 is simpler and cheaper.

Which approach fits: MERGE, Delta Lake time travel, or AUTO CDC?

We chose Databricks AUTO CDC for bitemporal SCD Type 2 because it was the only option that answers both audit questions without custom ordering logic.

MERGE, Delta Lake time travel or Databricks AUTO CDC: only bitemporal mode (Beta) keeps what was reported past retention

Table 4: How four implementation options handle the two audit questions.

The team’s first instinct was Delta Lake time travel. Query the dimension TIMESTAMP AS OF April 1 and you see what the report saw. The view holds only while both the data files and the log for that version survive. The Delta Lake VACUUM documentation sets the default file retention at 7 days, and log history defaults to 30 days. On Databricks Runtime 18.0 and above, time travel past delta.deletedFileRetentionDuration is blocked outright. Stretching both properties across a multi-year retention mandate keeps every rewritten file for the life of the table. That is a storage bill rather than a data model. Time travel is a recovery tool. Bitemporal history is stored as rows, so VACUUM and OPTIMIZE leave it intact.

An append-only audit log keeps every change, but answering a point-in-time question means replaying it, and two analysts can replay it two different ways.

Most SCD Type 2 Databricks pipelines still use a hand-written MERGE, which can carry a second date pair. The team then owns every out-of-order edge case on two axes at once. The AUTO CDC change data capture API already orders out-of-sequence events for standard history tables. Bitemporal AUTO CDC extends that to corrections that arrive with an earlier business or system time.

The trade-off is maturity. Bitemporal change data capture is in Beta, and the AUTO CDC APIs run only on serverless pipelines or the Pro and Advanced editions. While the feature is in Beta, Databricks directs teams to pin the pipeline to the PREVIEW channel.

How do you build bitemporal SCD Type 2 with Databricks AUTO CDC?

Declare a streaming table, then point an AUTO CDC flow at your change data capture feed. Give it two sequencing columns: SEQUENCE BY for business time and SYSTEM SEQUENCE BY for system time.

The source was a bronze change table fed by the lending platform’s CDC stream. We loaded it with the pattern from our guide to incremental data loading with PySpark. Each event carried borrower_id, the tracked attributes, an operation code, effective_date from the credit decision, and recorded_at, the time the event landed in bronze. We avoided the source commit time, because a report can only reflect what the warehouse held when it ran. We stamp recorded_at in UTC at ingestion, because a system-time axis built on mixed offsets produces beliefs that start before the events that caused them. Our post on Azure Synapse timezone conversion covers that failure mode.

Databricks AUTO CDC SQL: SEQUENCE BY business time, SYSTEM SEQUENCE BY system time, STORED AS BITEMPORAL, PREVIEW channel

Code 1: Bitemporal AUTO CDC flow in Lakeflow Spark Declarative Pipelines SQL. Run it in a non-production workspace first.

Why this works:SEQUENCE BY drives the business-time columns, so a review effective March 20 lands on March 20 no matter when it arrives. SYSTEM SEQUENCE BY drives the system-time columns, so the moment of arrival is kept as its own fact. When the April 3 event appeared, the engine closed row 1’s belief at 10:15 that morning. The engine then wrote rows 2 and 3, exactly as Table 1 shows. Python teams get the same behavior from dp.create_auto_cdc_flow() with sequence_by, system_sequence_by, and stored_as_scd_type="bitemporal".

Corrections, late data, and deletes. An out-of-order event carries an earlier business time than events already processed. The engine slots it into the business history rather than appending it, and closes only the beliefs it contradicts. Our credit review was in order on the business axis and simply late on the system axis, which the engine treats as an ordinary new version. A correction fixes a value that was wrong from the start. The fix arrives with the same business time as the bad record and a later system time. The wrong row’s system range ends where the fixed row begins, and the table still remembers the error. A delete matches APPLY AS DELETE WHEN and closes the business range at the date the record stopped existing. The close-out is effective from the moment the platform learned it. None of the three erases an earlier belief.

Choosing the clocks. The two sequencing columns are the real design decision in any SCD Type 2 Databricks pipeline. Using ingestion time for SEQUENCE BY quietly turns the table back into a load-date history, which is the bug we were fixing. Both columns must be sortable and non-null, so events missing an effective_date go to a quarantine table instead of receiving a default. Events for one borrower can land in one batch with identical sequencing values. We deduplicate on borrower, effective_date, and recorded_at, keeping the highest source log sequence number. The AUTO CDC SQL syntax reference also notes that COLUMNS TO UPDATE is not supported for bitemporal tables. The bitemporal documentation adds that AUTO CDC FROM SNAPSHOT is not supported, so snapshot-only sources need a change feed derived first.

Weighing a bitemporal rebuild against a regulator deadline? Ask our data engineering team for a one-dimension readiness review. We rebuild one of your past reports with an as-of query before you commit.

How do you query bitemporal history as of two dates?

Filter business time to the date in question and system time to the moment you want to reproduce. Set system time to now to get today’s corrected view.

The query that ended the audit dispute reproduces the March 31 report exactly as it stood when it was generated on April 1.

Bitemporal as-of SQL: half-open filters with system time pinned to the report run reproduce what a past report showed

Code 2: As-reported query. For the borrower in Table 1 it returns tier B from row 1.

Replace the system timestamp with current_timestamp() and the same query returns tier C, the corrected truth for March 31. We wrapped both forms in a two-parameter SQL table function, so analysts never hand-write the four predicates. For BI tools, a view filtered to __SYSTEM_END_AT IS NULL exposes the current belief as an ordinary history table. With a column rename and a far-future default for open end dates, it plugs straight into our Power BI SCD Type 2 historical reporting pattern.

Both ranges are half-open: the start is inclusive, the end is exclusive, and null means open-ended. Every predicate therefore pairs <= on the start with > on the end. A tier B row ending March 20 and a tier C row starting March 20 can never both match.

Joining fact tables follows the same rule. Each fact row picks the dimension version whose business range covers the fact’s own date. The whole query is pinned to one system moment, usually the report run time.

Point-in-time SQL join: each fact gets the bitemporal dimension version valid on its date, as believed when the report ran

Code 3: Point-in-time join from a fact table to the bitemporal dimension. A March 25 payment shows tier B here and tier C once the system time reaches 10:15 on April 3.

Range joins cost more than equality joins. For high-volume dashboards we materialize the current-belief view on a schedule and keep the full join for audit queries.

How did we validate the bitemporal table?

A shuffled replay of six months of events produced the same table as an ordered one, and that was only the first of three checks.

Validating bitemporal SCD Type 2 starts with that replay, because out-of-order handling is the feature the whole design depends on.

The second check guards downstream joins. Within the current belief, no borrower may have two business-time ranges covering the same day, or fact tables double-count.

SQL overlap check using LEAD: flags overlapping business-time ranges in current bitemporal rows before facts double-count

Code 4: Overlap check on the current belief. It runs after every pipeline update.

The third check exposed a hard limit: system time cannot be invented after the fact. The new table only knows what the platform believed from the day it started recording. We therefore converted archived report extracts into change events, using each report’s generation time as system time. We then ran the as-reported query at each filing timestamp in the backfill window. Our cross-system data reconciliation checks diffed each result against the archived extract. Cutover stayed blocked until every filing in the backfill window matched row for row.

What changed for the audit team?

The examiner’s question became a query with two dates, and the answer arrived with its own explanation.

The borrower that started the review now shows both facts. Tier B sits in the April 1 report, and tier C in the corrected history. The April 3 system timestamp links them. The compliance team retired its spreadsheet of known report differences, because the bitemporal SCD Type 2 dimension explains each one. The old pipeline kept running in parallel until reconciliation passed, and only then was it switched off.

Storage grew, as it must when every change adds rows instead of replacing them, and the growth rate tracks how often the source issues corrections. The data science team now pins training datasets to a system timestamp. Pinned datasets close the reproducibility gap we flag in most data readiness for AI assessments.

This case study is a composite drawn from ScriptsHub Technologies data engineering engagements. Client details and dates are generalized.

What are the trade-offs of bitemporal data?

You pay in rows and query complexity, and you depend on the source providing a trustworthy business date.

Storage is the visible cost: every change closes at least one belief and writes replacement rows, as Table 3 shows. Query complexity is the less visible cost, since every fact join becomes a range join.

Bitemporal data is only as good as the business time the source provides. A system that cannot supply a reliable effective date cannot feed a bitemporal table. The model also preserves bad data as faithfully as good data. A malformed event becomes a permanent belief, so quality checks belong before bronze. Platform risk is the last cost. Bitemporal AUTO CDC is Databricks-specific and in Beta, and open-source Apache Spark 4.2 ships only the SCD Type 1 API. SQL:2011 defines both application time and system versioning, but engines implement it unevenly. SQL Server temporal tables are system-versioned only, so business time there remains your own MERGE logic.

How do you roll out bitemporal history?

Roll out bitemporal SCD Type 2 one dimension at a time: pick the table auditors question, name both clocks, and prove the as-of queries before cutover.

Step 1: Pick one dimension. Choose the table behind most “why does the report differ?” tickets.

Step 2: Name both clocks in the source. Business time comes from the system of record’s effective date. System time comes from the warehouse ingestion timestamp, not the source commit time, stored in UTC. Reject nulls on either column.

Step 3: Backfill system time honestly. Convert archived snapshots or report extracts into change events, using the time each was produced as system time. Record the date from which system history is reliable.

Step 4: Declare the flow. Create the streaming table and an AUTO CDC flow with SEQUENCE BY, SYSTEM SEQUENCE BY, and STORED AS BITEMPORAL. Run it on a serverless, Pro, or Advanced pipeline, pinned to the PREVIEW channel while in Beta.

Step 5: Publish as-of access paths. Give analysts a two-parameter table function and BI tools a current-belief view.

Step 6: Prove it before cutover. Run the shuffled replay, the overlap check, and the report reconciliation. Block cutover on any mismatch.

Step 7: Plan for Beta. Keep the previous pipeline running in parallel and treat the current-belief view as your exit path, since it already looks like a standard history table.

Conclusion

Standard slowly changing dimensions tell you what was true. Bitemporal SCD Type 2 also tells you what you knew and when, and audits almost always turn on the second question.

Databricks AUTO CDC turns that from a custom engineering project into a declaration with two sequencing columns. The hard parts are choosing the right clocks and validating hard enough to trust a Beta feature with regulatory answers. Bitemporal history is also the cleanest route we know to a single source of truth in data analytics. Governance teams get the same lineage of beliefs that AI data governance now demands.

Can your warehouse explain why a filed report differs from today’s numbers? If not, contact ScriptsHub Technologies for a bitemporal readiness review of one dimension, or find us on LinkedIn.

Frequently asked questions

Q. What is the difference between SCD Type 2 and bitemporal SCD Type 2?

Standard SCD Type 2 tracks one timeline, usually business time and sometimes load time, so it shows when data changed or when it arrived. The bitemporal version tracks both, preserving what your database knew at any past moment.

Q. When should you use bitemporal modeling?

Use it for regulated financial reporting, insurance policy adjustments, healthcare claims, and compliance audits. It is essential whenever backdated corrections arrive late and you must reproduce historical reports exactly as they originally appeared.

Q. How does a bitemporal table handle late-arriving data?

When late or backdated data arrives, the table sets system_to on every affected record and inserts new rows with updated valid_from and valid_to dates. Historical records are never overwritten, preserving full auditability.

Q. How do you query a bitemporal table in SQL?

Use half-open filters on both ranges: start on or before the date, and end after the date or null. Apply one to business time and one to system time. Avoid BETWEEN, which drops open-ended rows.

Q. Is AUTO CDC the same as APPLY CHANGES?

Yes. AUTO CDC replaces the APPLY CHANGES APIs with the same syntax. APPLY CHANGES still works, but Databricks recommends AUTO CDC, and bitemporal storage is available only through AUTO CDC.

Q. Can Snowflake Time Travel or Delta Lake replace bitemporal modeling?

No. Both keep only storage versions inside a retention window, up to 90 days in Snowflake and 7 days of data files by default in Delta Lake. Neither tracks business valid time.

This post got you thinking? Share it and spark a conversation!