Data lake and pipeline design
From raw events to useful data
A data lake stores datasets, often as files in object storage, independently of the compute engines that process them. A data pipeline transports and transforms data into a form that consumers can use. Imagine a bookstore exporting order events. Raw events arrive as JSON; a daily job validates and deduplicates them; a curated table contains accepted orders; an aggregate serves daily sales. The raw copy supports replay, but access and retention must be restricted. A lake without a catalog, ownership or quality checks can become difficult to use.
The pipeline stages are ingestion → durable landing → validation and transformation → catalog and publication → consumption. Store a source batch identifier, schema version, event time and ingestion time. A successful upload is not a successful publication: readers should see only a committed, validated batch. An orchestrator coordinates dependencies, retries, deadlines, backfills and notifications; it does not necessarily execute the transformation itself.
Choose batch, streaming, ETL or ELT
Batch processing works on bounded collections, such as yesterday's orders. Streaming processes an ongoing flow; it must account for delayed events, duplicates, checkpoints and backpressure. A nightly batch may be enough for finance reporting, while a stock availability signal may require lower latency. Streaming introduces continuous compute and operational complexity. Micro-batching groups small time intervals; it does not remove late-event handling.
ETL (extract, transform, load) transforms before loading the target analytical store. ELT (extract, load, transform) lands data first and transforms using the destination engine. A pipeline may use both: validate and redact before loading, then aggregate in SQL. Never use ELT as justification for storing unnecessary personal data. For replay, use immutable source batch IDs and idempotent writes, and avoid committing a new output until quality checks pass. On failure, preserve the previous published version and record a reason without exposing raw sensitive values.
File formats, partitions and catalogs
| Format | Typical use | Trade-off |
|---|---|---|
| CSV | Simple tabular interchange | Types and escaping require a contract; nested structures are awkward |
| JSON / JSON Lines | Flexible event interchange | Text parsing, explicit schema checks and repeated field names |
| Parquet | Typed column-oriented analytical data | Binary format; requires compatible readers and sensible file sizes |
Parquet is a file format, not a transaction manager. A table format adds metadata and commit semantics across data files. A catalog maps logical names to schema, location and table metadata; it can integrate with access control but does not automatically protect object paths.
For orders, partition curated data by event date when queries typically filter by day. Partition pruning lets a compatible engine skip irrelevant partitions; column projection lets a columnar engine avoid unnecessary columns. A path such as orders/day=2026-01-03/part-000.parquet is an illustrative convention, not a real object. Avoid partitioning by unique order ID: millions of tiny partitions or files increase planning and request overhead. Compact small files with an engine that coordinates updates safely. Track partition counts, skew and query patterns. Late data must update the correct event-day partition; ingestion date and event date are not interchangeable.
Estimate scan, processing and storage costs
Assume 30 daily partitions, each 20 GB (decimal), uniformly sized. A three-day query with effective pruning reads 60 GB rather than 600 GB. Suppose a column projection reads one quarter of the relevant bytes: 15 GB. These fractions are an invented model; compression, metadata, data distribution and engine behavior change actual billed bytes. At a fictional $5/TB (1 TB = 1000 GB), the modeled scan costs $0.075 versus $3.00 for 600 GB. Some engines bill by capacity or compute time instead; minimums and rounding may apply.
If a transformation uses 4 workers for 0.5 hours at a fictional $0.40 per worker-hour, compute is $0.80/run. Thirty daily runs cost $24. If retained raw, curated and aggregate storage occupy 600, 240 and 10 GB throughout a month, at a fictional $0.02/GB-month the total is $17.00. Ten 15-GB queries a day for 30 days cost $22.50; modeled total $63.50/month. Excludes requests, catalog, orchestration, network transfer, temporary files, backups, compaction and taxes. Track each category separately; no actual quote or benchmark.
Map responsibilities to cloud services
| Cloud | Ingestion / transformation | Storage / query / governance |
|---|---|---|
| AWS | Glue ETL jobs and external orchestration | S3 objects; Glue Data Catalog; Athena SQL queries; Lake Formation permissions for supported integrations |
| Azure / Microsoft Fabric | Azure Data Factory or Fabric Data Factory pipelines; Spark workloads where appropriate | Azure storage or Fabric OneLake lakehouse; Fabric uses Delta tables by default; workspace and data permissions differ |
| Google Cloud | Dataflow for Apache Beam batch/stream processing; Dataproc / Managed Service for Apache Spark for Spark and Hadoop workloads | Cloud Storage files and BigQuery analytical tables; integration via supported connectors |
These are examples, not interchangeable products. ADF and Fabric Data Factory have different capabilities and deployment/licensing models. BigQuery is a query and warehouse service, not simply a catalog; Dataflow is a processing service, not a warehouse. Check region, capacity/licensing, connectors, versions, support for table operations and charges before selecting. See Glue partition management, Athena optimization, ADF/Fabric comparison, Dataflow overview, Managed Spark, and BigQuery writes. Official search excerpts reviewed; regional availability and licensing remain deployment checks.
Practice: design a replayable batch
A source exports 20 GB/day. Choose raw, curated and reporting layers; name the batch and event keys; identify the point where a reader can see the new version. Estimate a two-day query with half-column projection: 20 GB, assuming perfect pruning and proportional projection. Compare with 600 GB for the full month. If an event arrives a day late, update its event-day partition under the same deduplication contract, rather than silently putting it in the current day. Next, implement local quality checks before publication.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Data lake and pipeline design — knowledge check
Choose the best answer for each offline scenario.
Which component maps a table name to metadata?
Why partition by event day rather than unique order ID?
What is modeled scan volume for 3 days of 20 GB each and one quarter of columns?
What distinguishes ELT from ETL?
What does an orchestrator primarily do?