Prerequisites
- !ADLS Gen2 containers and directories
- !Why analytical data is stored in columnar files
- !The difference between schema on write and schema on read
What You'll Learn
- 1Define zone boundaries by who may write and what guarantee the data carries
- 2Design a naming and path convention that supports partitioning and access control
- 3Separate bronze, silver and gold responsibilities without inventing new zones
- 4Apply retention and lifecycle rules per zone rather than estate-wide
- 5Explain why a lake without contracts degenerates into a data swamp
Zones are contracts, not folders
The reason zone-based design works is that each zone answers a different question. Landing answers "what did the source send". Raw answers "what did we receive and when". Curated answers "what does the business agree this means". Serving answers "what may a dashboard read". Once those questions are separate, permissions, retention and quality expectations all become local decisions instead of estate-wide arguments.
The boundary rule that keeps this honest is write access. Only ingestion identities write to landing and raw. Only transformation jobs write to curated. Only promotion jobs write to serving. Nobody, human or service, gets write access across zones, because a lake where engineers can casually overwrite curated data has no guarantee to offer anyone downstream.
A common variation uses the medallion vocabulary of bronze, silver and gold. Those names map closely onto raw, curated and serving, and the mapping matters less than the discipline: whatever you call them, the number of zones should stay small. Every extra zone introduces another permission boundary, another retention policy and another promotion step that someone must own.
| Zone | Contents | Written by | Read by | Retention posture |
|---|---|---|---|---|
| Landing | Source files as delivered | Source or ingestion identity | Ingestion validation only | Days, lifecycle deletes |
| Raw | Validated copies with arrival date | Ingestion jobs | Transformation, audit | Months to years by class |
| Curated | Conformed, documented models | Transformation jobs | Analysts, downstream loads | Long, versioned |
| Serving | Optimised for a known consumer | Promotion jobs | BI, applications | Aligned to the consumer's SLA |
| Sandbox | Experiments and one-offs | Named individuals | Their owner | Weeks, aggressively expired |
Path conventions that carry their own metadata
A path in a lake is read by people, by query engines and by access control policy, so its structure should communicate all three. The convention that works is entity first, then Hive-style partition columns, then files, with every prefix carrying meaning that a reader can rely on.
Prefixes such as dt= are not decorative. Query engines recognise them as partition columns and use them to skip files, so a path convention is a performance decision as much as an organisational one. The same applies to file formats: Parquet for anything queried analytically, JSON or CSV only in landing where the source dictates it.
abfss://[email protected]/
landing/
erp/orders/2026/10/11/orders_20261011_020000.csv
raw/
erp/orders/dt=2026-10-11/hour=02/part-00000-abc.parquet
erp/orders/dt=2026-10-11/hour=03/part-00000-def.parquet
curated/
sales/fact_order/dt=2026-10-11/part-00000-ghi.parquet
sales/dim_customer/version=3/part-00000-jkl.parquet
serving/
bi/revenue_daily/
api/customer_360/
_control/
runs/dt=2026-10-11.json
contracts/erp_orders_v2.json
The _control area deserves emphasis. Run manifests record what was written and when, contracts record the expected schema and row counts, and both make reconciliation possible without scanning data. A lake without a control area can be queried but not trusted, because there is nothing to compare a result against.
Hour-level sub-partitioning is worth adding only when hourly volume or hourly queries justify it. Partitioning too finely creates millions of small directories that cost more in listing operations than they save in pruning, which is the same failure mode as over-partitioning a table.
Schema evolution and who is allowed to break things
Schema on read means the files keep whatever schema they were written with and readers interpret them. That flexibility is powerful and dangerous: a producer adds a column, a downstream projection assumes it is absent, and the failure appears far from the change.
The rule that prevents this is additive-by-default. Producers may add nullable columns at the end of the record. Renaming, removing or changing a type is a breaking change that requires a contract version bump, a notification window and a coordinated consumer migration. Encoding that rule in a validation step at landing, where the file is checked against the registered contract before it is promoted to raw, turns a social agreement into a gate.
Schema merging tools can reconcile minor differences automatically, but automatic merging hides the moment when a change crossed from additive to breaking. Prefer an explicit version in the path or the contract, so a reader knows which shape it is dealing with rather than inferring it from the data.
Ownership, discovery and the swamp boundary
A data swamp is not a storage problem. It is a bookkeeping problem: nobody knows what a file is, who owns it, whether it is current or whether it may be read. The three attributes that keep a lake out of that state are an owner, a classification and a freshness marker, all attached to the dataset rather than to the folder.
Ownership should be a team, not a person, because a person changes teams and the folder becomes orphaned. Classification drives retention and access, and it must be applied at the point where personal data lands rather than discovered later during an audit. Freshness lets a reader distinguish a maintained table from something last written eighteen months ago.
import json
from datetime import datetime, timezone
def write_json(path, record):
payload = json.dumps(record, indent=2, sort_keys=True)
with open(path, "w", encoding="utf-8") as handle:
handle.write(payload)
def register_dataset(name, zone, owner, classification, path, contracts):
record = {
"name": name,
"zone": zone,
"owner": owner,
"classification": classification,
"path": path,
"contract": contracts.get(name, {}).get("version"),
"registered_at": datetime.now(timezone.utc).isoformat(),
"sla_minutes": contracts.get(name, {}).get("sla_minutes"),
}
control_path = f"_control/contracts/{name}.json"
write_json(control_path, record)
return record
def assert_fresh(record, watermark):
age_minutes = (datetime.now(timezone.utc) - watermark).total_seconds() / 60
if record["sla_minutes"] and age_minutes > record["sla_minutes"]:
raise RuntimeError(
f"{record['name']} is {age_minutes:.0f} minutes old against an SLA of "
f"{record['sla_minutes']} minutes"
)
The freshness assertion is deliberately simple. It does not care why the data is late, only that it is, which is exactly the question a consumer asks.
Cost control by zone
Storage is cheap per gigabyte and not cheap at petabyte scale, and the distribution of bytes across zones is where the budget goes. Landing holds the newest data and should be on hot tier with a short life. Raw holds the bulk and benefits most from cool tier after a few weeks. Curated is smaller and hot. Sandbox is small but grows without discipline unless expired automatically.
Lifecycle rules encode this. A typical policy moves landing files to delete after seven days, raw partitions to cool after thirty days and to archive after two years, and expires sandbox content after fourteen. The important detail is that these rules are set per container or per path prefix, so a single estate-wide policy is the wrong tool.
Egress is the cost people miss. Reading from one region to another, or out of Azure entirely, is charged separately from storage, so placing the lake close to its consumers and its compute is a cost decision as much as a latency one.
Lakehouse, warehouse or both
The lakehouse pattern stores curated tables as open formats with a transaction log on top of the lake, giving warehouse-like guarantees such as ACID transactions and time travel without copying data into a proprietary store. For many estates this removes a real duplication: the same fact table existing in Delta on ADLS and again in a dedicated pool.
The warehouse still earns its place where concurrency and SQL features matter more than open format flexibility, or where a semantic layer is already built on it. The pragmatic answer is usually both, with the lake as the system of record and the warehouse serving the specific workloads that justify its cost.
Whichever you choose, keep the serving layer derived. Rebuilding it from curated data should be possible at any time, which is the property that makes a lake architecture recoverable rather than merely stored.
Common Mistakes
Letting engineers write directly into curated for a quick fix
Fix: Restrict write access to promotion jobs so the zone's guarantee still means something
Adding a new zone for every team's preference
Fix: Keep the zone count small and stable; express team differences through permissions and namespaces inside a zone
Partitioning every entity down to the hour regardless of volume
Fix: Choose partition granularity from file size and query pattern, aiming for files in the low hundreds of megabytes
Applying one lifecycle policy across the whole estate
Fix: Set retention per zone and per data class, since landing, raw and curated have genuinely different value curves
Best Practices
- Treat paths as a public interface and version them when they must change
- Validate incoming files against a registered contract before promoting them out of landing
- Record ownership, classification and freshness on the dataset, not in a wiki
- Design so serving can always be rebuilt from curated
Interview Questions
Q1: What defines a zone boundary in a data lake?
Write access and the guarantee the data carries. Only specific identities may write into a zone, and each zone promises a different level of conformance and documentation.
Q2: Why use Hive-style partition prefixes such as dt=?
Query engines recognise them as partition columns and use them for file pruning, so the naming convention directly determines how much data a query reads.
Q3: What makes a lake a data swamp?
Missing ownership, classification and freshness information. Storage works fine; nobody can tell what a dataset is, whether it is current or who may read it.
Q4: How should schema changes be handled?
Additive nullable changes may proceed, while renames, removals and type changes require a contract version bump with a coordinated consumer migration, enforced by validation at landing.
Q5: When is a lakehouse pattern appropriate?
When curated tables should have ACID guarantees and time travel on open formats, avoiding duplication between the lake and a proprietary warehouse while keeping serving rebuildable.
Key Takeaways
- Zones are defined by write access and the promise each layer makes
- Path and partition conventions are performance decisions, not just organisations
- Contracts plus validation at landing are what stop schema drift becoming an incident
- Ownership, classification and freshness are the three attributes that prevent a swamp
- Lifecycle rules belong per zone, because data value decays at different rates