Skip to main content

08.8 Bronze Layer Deep Dive

1. What Bronze really means​

Bronze is the source-fidelity boundary of a lakehouse.

Its primary responsibility is not cleansing. It is to preserve enough information to answer:

What exactly did the source send us, when did we receive it, and can we replay it?

Databricks describes Bronze as raw, incrementally appended data that preserves source fidelity and enables reprocessing and auditing. Minimal validation is preferred so unexpected source changes do not cause silent data loss. Databricks medallion architecture

A mature Bronze design therefore optimizes for:

  • completeness;
  • replayability;
  • provenance;
  • schema-drift resilience;
  • operational observability;
  • controlled retention;
  • security.

2. Bronze is not a dirty Silver​

A useful distinction:

BronzeSilver
Preserve source evidenceEstablish trusted representation
Minimal transformationCleansing and normalization
Replay boundaryBusiness/data-quality boundary
Source-orientedConsumer/reusable-data oriented
Raw historyValidated history

Do not put business rules into Bronze simply because it is convenient.

3. The Bronze architecture​

                 SOURCE SYSTEMS
+-------------+-------------+-------------+
| | | |
S/4 CRM Kafka S3
| | | |
+-------------+-------------+-------------+
|
v
INGESTION / DISCOVERY
Auto Loader / CDC / APIs
|
v
BRONZE DELTA TABLE
raw + metadata + replay state
|
+----------+----------+
| |
v v
SILVER QUARANTINE

The Bronze table is the durable handoff between ingestion and transformation.

4. Source fidelity​

The most important Bronze rule is:

Do not destroy information before the first durable landing.

For example, suppose a source sends:

{
"customer_id": "C100",
"credit_limit": "10000",
"region": "IN"
}

If Bronze immediately casts and transforms everything into a business model, source evidence may be lost.

A safer pattern is to preserve the raw representation plus ingestion metadata and perform authoritative typing in Silver.

Databricks specifically recommends minimizing cleanup in Bronze and, for resilient ingestion, storing many fields as strings, VARIANT, or binary when appropriate. Databricks medallion guidance

5. Bronze metadata​

Metadata turns raw data into operationally useful raw data.

Common columns:

_source_system
_source_entity
_ingest_timestamp
_ingest_date
_batch_id
_event_id
_source_sequence
_source_file
_source_file_modified_time

For file ingestion, Auto Loader exposes the _metadata column. Databricks recommends capturing at least source file path and modification time for traceability. Auto Loader best practices

6. Bronze ingestion patterns​

File ingestion​

S3
|
v
Auto Loader
|
v
Bronze Delta

CDC ingestion​

Source DB / S/4HANA
|
v
CDC feed
|
v
Bronze event table

Event ingestion​

Kafka / Kinesis
|
v
Structured Streaming
|
v
Bronze

API ingestion​

REST API
|
v
Landing files / raw records
|
v
Bronze

The ingestion mechanism can vary. The Bronze contract remains the same: preserve evidence and provenance.

7. Auto Loader as a Bronze pattern​

Auto Loader incrementally discovers new files in cloud storage and is a common production choice for file-based Bronze ingestion.

A basic Python pattern:

df = (
spark.readStream
.format("cloudFiles")
.option("cloudFiles.format", "json")
.option("cloudFiles.schemaLocation", "/Volumes/main/ops/schema/orders")
.load("/Volumes/main/landing/orders")
)

bronze = df.select(
"*",
"_metadata.file_path",
"_metadata.file_modification_time"
)

For production, the checkpoint and schema state must be treated as durable infrastructure rather than temporary notebook state.

8. Schema evolution is a Bronze decision​

Source schemas change.

Examples:

  • new column;
  • renamed column;
  • changed type;
  • casing difference;
  • nested structure change.

Auto Loader supports multiple schema-evolution strategies including addNewColumns, addNewColumnsWithTypeWidening, rescue, failOnNewColumns, and none. Auto Loader schema evolution

The correct mode depends on the source contract.

9. Strict vs resilient Bronze​

Strict contract​

Use when upstream changes must stop the pipeline.

New column
|
v
FAIL
|
v
Human review

Useful for highly controlled interfaces.

Resilient ingestion​

Use rescue when preserving unexpected fields is more important than immediately evolving the target schema.

Unexpected data lands in _rescued_data. Auto Loader uses this column to preserve fields that do not match the inferred schema, including certain type and casing mismatches. Databricks schema evolution

10. Rescued data is not a garbage bin​

_rescued_data should be monitored.

A mature pattern is:

Bronze
|
+--> normal records
|
+--> _rescued_data != NULL
|
v
drift investigation

If rescued data continuously grows, the source contract is changing or the ingestion design is incomplete.

11. Corrupt records​

Schema mismatch and malformed records are different problems.

  • _rescued_data captures fields that do not fit the current schema.
  • _corrupt_record can capture records that cannot be parsed.

Databricks recommends using columnNameOfCorruptRecord for corrupt-record handling rather than relying on badRecordsPath in production patterns. Auto Loader best practices

A Bronze pipeline should make bad input observable rather than silently dropping it.

12. VARIANT for unpredictable sources​

For highly variable semi-structured data, Auto Loader can ingest the entire record into a VARIANT column.

This can be useful when:

  • schemas change frequently;
  • vendor payloads are poorly governed;
  • multiple payload versions coexist.

Trade-off:

Flexible ingestion moves more schema interpretation into downstream queries.

VARIANT is not automatically the best solution. Structured columns are generally easier and more efficient for predictable analytical workloads. Databricks documents VARIANT as a schema-flexible ingestion option. Databricks VARIANT ingestion

13. Checkpoints are state, not data​

A streaming checkpoint records processing state.

It should not be treated as another copy of the Bronze dataset.

Production rules:

  • use a dedicated checkpoint location;
  • never share checkpoints between independent streams;
  • do not apply object lifecycle deletion to checkpoint state;
  • keep checkpoints durable;
  • keep source and checkpoint responsibilities separate.

Databricks warns that deleting checkpoint files can corrupt stream state and require restarting from scratch. Auto Loader best practices

14. Schema location vs checkpoint​

Do not confuse:

Schema location​

Stores Auto Loader's inferred/evolved source schema state.

Checkpoint​

Stores streaming progress and state.

They serve different purposes.

A production architecture should explicitly manage both.

15. File discovery and cost​

At high file volumes, file discovery itself can become a cost and latency concern.

Auto Loader supports file-event based discovery as well as directory listing approaches.

The architect should evaluate:

  • file arrival rate;
  • directory size;
  • discovery latency;
  • cloud API cost;
  • source storage behavior.

Do not blindly scan enormous directories when a scalable event-driven discovery pattern is available.

16. Small files​

Bronze is particularly vulnerable to small-file proliferation.

Sources may generate:

10,000 tiny JSON files
|
v
10,000 tiny Delta output files

This creates:

  • metadata overhead;
  • slower reads;
  • inefficient scans;
  • more file-management work.

Control file layout through appropriate ingestion and downstream optimization strategies rather than creating arbitrary partitions.

17. Partitioning Bronze​

Avoid automatically partitioning Bronze by high-cardinality fields such as customer ID.

A sensible partition candidate is usually a low-cardinality, frequently filtered attribute such as an ingestion date, but modern Delta layout capabilities can make explicit partitioning unnecessary for many workloads.

Benchmark rather than assuming partitioning is beneficial.

18. Bronze table naming​

A consistent naming convention helps operations.

Examples:

bronze.sap_customer_cdc
bronze.s4_material_events
bronze.salesforce_account_raw
bronze.kafka_order_events

Name datasets according to source/entity semantics rather than implementation details that will become obsolete.

19. Bronze and Unity Catalog​

Bronze is still governed data.

Unity Catalog should control:

  • who can discover Bronze;
  • who can query it;
  • who can modify it;
  • where it is physically stored;
  • lineage;
  • audit;
  • retention;
  • service-principal access.

A common enterprise pattern is to restrict direct Bronze access to engineering, platform, and controlled data-product teams.

20. Managed vs external Bronze​

Bronze storage deserves special attention.

Databricks reliability guidance notes that external tables can be useful for raw Bronze data so the source-preservation layer remains independent of the lifecycle of a managed table. Databricks reliability best practices

The correct choice depends on:

  • ownership;
  • retention;
  • migration;
  • external consumers;
  • storage controls;
  • disaster recovery;
  • governance requirements.

Do not choose managed vs external solely based on habit.

21. Bronze security​

Bronze may contain more sensitive data than Gold because it is closer to the source.

Examples:

  • raw PII;
  • source identifiers;
  • operational payloads;
  • financial fields;
  • technical credentials accidentally included by poor sources.

Therefore:

Raw does not mean unrestricted.

Apply Unity Catalog permissions, storage controls, network controls, encryption, auditing, and retention policies.

22. Bronze retention​

Bronze retention should answer:

How far back must we be able to reconstruct downstream data?

Factors:

  • regulatory requirements;
  • source replay capability;
  • business recovery objectives;
  • cost;
  • CDC retention;
  • downstream rebuild time.

A short retention window can destroy the ability to reproduce historical Silver/Gold results.

23. Bronze replay architecture​

             BRONZE
|
+-------+-------+
| |
v v
SILVER A SILVER B
| |
v v
GOLD A GOLD B

If transformation logic changes, Silver can be rebuilt from durable Bronze.

This is one of the strongest architectural benefits of the lakehouse pattern.

24. Idempotency​

A Bronze pipeline should tolerate retries.

Suppose the same file or event is observed twice.

You need an explicit strategy:

  • Auto Loader file tracking;
  • event IDs;
  • source sequence numbers;
  • ingestion batch IDs;
  • downstream deduplication where necessary.

Do not assume that “streaming” automatically means “exactly once business semantics.”

25. Bronze for CDC​

For CDC, Bronze should normally preserve the change event rather than immediately collapsing it.

Example:

customer_id | operation | sequence | city
C100 | I | 10 | Delhi
C100 | U | 20 | Mumbai
C100 | U | 30 | Bengaluru
C100 | D | 40 | Bengaluru

Silver can then apply the correct SCD1/SCD2 semantics.

This makes replay and investigation much easier.

26. Bronze for SAP​

A strong SAP pattern is:

S/4HANA
|
SLT / CDC / extraction
|
v
Bronze
|
+-- source object
+-- operation
+-- sequence
+-- ingestion timestamp
|
v
Silver

For SAP landscapes, preserve enough technical metadata to reconcile source changes and investigate replication gaps.

27. Bronze observability​

Monitor at least:

MetricWhy
Files/events receivedCompleteness
Files/events processedProgress
Processing latencySLA
Rescued recordsSchema drift
Corrupt recordsSource quality
Duplicate rateIdempotency
Bytes ingestedCost
Input rateCapacity
Checkpoint agePipeline health
Latest source timestampFreshness

For Auto Loader, file state can be inspected using the available file-state observability mechanisms such as cloud_files_state() where applicable. Auto Loader best practices

28. Bronze data-quality contract​

Bronze should have minimal quality rules, but not zero observability.

Good Bronze checks:

  • ingestion timestamp exists;
  • source identifier exists;
  • event/file identity is present;
  • malformed records are captured;
  • schema drift is visible;
  • source freshness is measured.

Avoid turning Bronze into a fully cleansed business model.

29. Bronze → Silver boundary​

A useful contract:

BRONZE guarantees:
"I preserved the source evidence."

SILVER guarantees:
"I interpreted and validated it."

This makes ownership clear.

If a dashboard is wrong because a source field was malformed, the investigation can determine whether the defect occurred in:

  1. source;
  2. ingestion;
  3. Bronze;
  4. Silver;
  5. Gold.

30. Production pattern​

A robust production flow:

Cloud storage
|
v
Auto Loader
|
+--> schema state
+--> checkpoint
|
v
Bronze Delta
|
+--> rescued data monitoring
+--> corrupt-record monitoring
+--> freshness monitoring
|
v
Silver

For production workloads, Databricks recommends Auto Loader with Lakeflow pipelines for many incremental-ingestion scenarios, while Structured Streaming provides more direct control when customization requires it. Auto Loader production guidance

31. Lab 1 — Raw file ingestion​

Create an S3 or volume landing directory.

Ingest JSON files with Auto Loader.

Capture:

  • source file path;
  • modification time;
  • ingestion timestamp;
  • batch identifier.

Verify that newly arriving files are processed incrementally.

32. Lab 2 — Schema drift​

Start with:

{"id":1,"amount":100}

Then introduce:

{"id":2,"amount":200,"currency":"INR"}

Test:

  • addNewColumns;
  • rescue;
  • failOnNewColumns.

Document which behavior your production interface requires.

33. Lab 3 — Rescued data​

Introduce a type mismatch.

Verify that unexpected data lands in _rescued_data rather than disappearing.

Build a monitoring query that counts rescued records by ingestion date and source.

34. Lab 4 — Replay​

Stop Silver.

Continue Bronze ingestion.

Then rebuild Silver from Bronze.

Measure:

  • recovery duration;
  • data completeness;
  • duplicate behavior;
  • downstream reconciliation.

Your architecture should prove that Bronze is actually replayable, not merely claim that it is.

35. Architect exercise​

Design Bronze for:

  • 5 million files/day;
  • 2 TB/day;
  • 30 source systems;
  • JSON + Parquet;
  • schema drift;
  • CDC;
  • 15-minute SLA;
  • 7-year regulatory retention for selected domains;
  • sensitive customer data.

Decide:

  1. ingestion framework;
  2. file discovery;
  3. schema strategy;
  4. checkpoint architecture;
  5. metadata columns;
  6. rescued-data policy;
  7. retention;
  8. Unity Catalog structure;
  9. security;
  10. observability;
  11. replay strategy;
  12. cost controls.

36. Anti-patterns​

Business transformations in Bronze​

Creates an irreversible dependency on today's business logic.

Dropping unknown columns​

Can silently destroy source information.

Shared checkpoints​

Creates state corruption and operational ambiguity.

No provenance metadata​

Makes root-cause analysis unnecessarily difficult.

Unlimited raw retention​

Can create large, uncontrolled storage costs.

Raw unrestricted access​

Creates a major governance and privacy risk.

Direct Bronze-to-dashboard reporting​

Couples consumers to unstable source-oriented structures.

37. Production checklist​

  • Source fidelity is defined.
  • Replay requirement is documented.
  • Source provenance is captured.
  • Ingestion timestamp is captured.
  • Event/file identity is defined.
  • Schema evolution mode is intentional.
  • Rescued data is monitored.
  • Corrupt records are observable.
  • Checkpoints are durable and isolated.
  • Schema state is durable.
  • File discovery strategy is cost-aware.
  • Small-file behavior is monitored.
  • Retention is documented.
  • Unity Catalog access is restricted.
  • Sensitive Bronze data is protected.
  • Freshness and completeness metrics exist.
  • Replay has been tested.
  • CDC events remain reconstructable where required.
  • Bronze-to-Silver contract is documented.

38. Architect mental model​

               BRONZE
|
+----------+----------+
| | |
SOURCE STATE PROVENANCE
FIDELITY CHECKPOINT METADATA
| | |
+----------+----------+
|
v
REPLAYABLE
TRUTH
|
v
SILVER

Bronze is not “the table before cleaning.” Bronze is the enterprise recovery and source-evidence boundary.

If Bronze is trustworthy, downstream layers can evolve without repeatedly depending on the source system.

Further reading​