Cert Notes/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
SCS-C03 · SpecialtySecurity - Specialty
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
  • Week 1
    • 1.What Is Data Engineering
    • 2.Batch vs Streaming
    • 3.A Bird's-Eye View of AWS Data Services
    • 4.Data Formats and Modeling
    • 5.Week 1 Comprehensive Review
  • Week 2
    • 1.Batch Ingestion: S3 Upload, DataSync, Transfer Family, Snow
    • 2.Kinesis Data Streams: Shards, Partition Keys, and Throughput
    • 3.Kinesis Data Firehose: Delivery Streams and Loading
    • 4.Amazon MSK (Kafka): Topics, Partitions, and When to Use What
    • 5.Week 2 Synthesis: Data Ingestion Part 1 Review
  • Week 3
    • 1.Streaming Processing: Managed Service for Apache Flink and Window Aggregation
    • 2.Ingestion Reliability: Idempotency, Ordering, Retries, Deduplication, DLQ
    • 3.CDC and Data Replication: Database Migration Service (DMS)
    • 4.Ingestion Architecture Patterns: Lambda Architecture and Event-Driven Ingestion
    • 5.Week 3 Synthesis: Data Ingestion Part 2 Review
  • Week 4
    • 1.Glue Data Catalog and Crawlers: Adding Metadata to Data
    • 2.Glue ETL Job: Transform Data on Spark
    • 3.Glue Studio and DataBrew: Transform Without Code
    • 4.Schema Management and Data Quality: Tolerate Evolution, Guarantee Trust
    • 5.Week 4 Synthesis: The Big Picture of AWS Glue Transformation
  • Week 5
    • 1.Amazon EMR: Spark, Hive and Cluster Operations, Plus EMR Serverless
    • 2.Lambda Transformation and Lightweight Processing: Event-Driven ETL's Limits and Fit
    • 3.Orchestration: Step Functions, MWAA, and Glue Workflows Selection Criteria
    • 4.Performance and Cost Optimization: File Format, Compression, Partitioning, and Small File Problem
    • 5.Week 5 Synthesis: Data Transformation 2 — Engines, Orchestration, Optimization Integration Review
  • Week 6
    • 1.S3 Data Lake Layout and Partitioning Strategy
    • 2.AWS Lake Formation Central Permission Management
    • 3.Open Table Formats: Iceberg, Hudi, Delta Lake
    • 4.S3 Storage Management and Cost Optimization
    • 5.Week 6 Comprehensive Review: Data Lake Recap
  • Week 7
    • 1.Amazon Redshift: Distribution and Sort Keys and Workload Optimization
    • 2.Amazon Athena: Serverless Queries and Cost Optimization
    • 3.DynamoDB (Analytics Perspective): Key Design and Stream-Based Pipelines
    • 4.RDS/Aurora and Store Selection: OLTP, Zero-ETL, Workload-to-Store Decision
    • 5.Week 7 Comprehensive Review: Analytics Stores Recap
  • Week 8
    • 1.Pipeline Monitoring: CloudWatch Metrics, Logs, and Alarms
    • 2.Data Quality and Validation: Glue Data Quality and Quality Gates
    • 3.Logging, Audit, and Troubleshooting: CloudTrail and Failure Recovery
    • 4.Cost and Performance Operations: Monitoring, Sizing, Auto Scaling
    • 5.Week 8 Comprehensive Review: Data Operations and Support Recap
  • Week 9
    • 1.Access Control: IAM and Lake Formation Permissions
    • 2.Encryption: KMS and Service-Specific Encryption
    • 3.Sensitive Data Protection: Macie and Masking
    • 4.Data Governance: Catalog, Lineage, Sharing, Auditing
    • 5.Week 9 Synthesis: Security and Governance Review
  • Week 10
    • 1.Integrated Review of Domains 1 & 2: Ingestion, Transformation & Storage Management
    • 2.Integrated Review of Domains 3 & 4: Operations & Support, Security & Governance
    • 3.Full-Length Practice Exam Pace: 8 Integrated Scenarios
    • 4.Common Traps & Keywords: "Requirement → Service" Translation Guide
    • 5.Final D-Day Prep: Exam Structure, Time Management & Scenario Breakdown Strategy
MLS-C01 · SpecialtyMachine Learning - Specialty
← DEA-C01/Week 1/Day 4
DEA-C01· AssociateWeek 1 · Day 4~18 min read

Day 4 - Data Formats and Modeling

The same data, stored in different file formats, can differ 100x in query speed and 10x in cost. When a data analyst asks "why does this query take five whole minutes?", the answer is often "because the data is stored as CSV." A one-line transformation converting CSV to Parquet is frequently the single most effective optimization.

Today we compare the file formats a data engineer faces daily — CSV, JSON, Parquet, ORC, Avro — understand the essence of their differences, columnar vs row-based storage, and look at schema evolution, which deals with the reality that data structures change over time.

The Five Formats at a Glance

FormatStructureHuman-readableCompressionPrimary Use
CSVRow-based, textYesWeakSimple exchange, legacy
JSONRow-based, textYesWeakAPIs, nested structures, logs
ParquetColumnar, binaryNoStrongThe standard for analytics (OLAP)
ORCColumnar, binaryNoStrongHive-ecosystem analytics
AvroRow-based, binaryNoMediumStreaming, schema evolution

There are broadly three groups. Text-based (CSV/JSON) formats are easy for humans to read and highly compatible, but inefficient. Columnar binary (Parquet/ORC) formats are optimized for analytical queries. Row-based binary (Avro) is strong at writes and schema evolution, so it's used for streaming and events.

💡 Related theory: Format choice follows the workload. "Frequent writes, often handling entire records (write-heavy)" → row-based (Avro). "Read-heavy, aggregating only specific columns (read-heavy, analytical)" → columnar (Parquet/ORC). This one line is the criterion for picking a format on the exam.

Columnar vs Row-Based: The Essence of the Difference

This is today's core. It's the difference in how the same table is laid out on disk.

Original table
  id | name  | amount
  1  | Kim   | 100
  2  | Lee   | 200
  3  | Park  | 300

Row-based storage — CSV, Avro
  [1,Kim,100][2,Lee,200][3,Park,300]
  Each row is kept together as a whole

Columnar storage — Parquet, ORC
  [1,2,3][Kim,Lee,Park][100,200,300]
  Values of the same column are kept together

Consider an analytical query like SELECT SUM(amount). With row-based storage, reading amount requires scanning id and name too — everything. With columnar storage, reading just the [100,200,300] block is enough. Because only the needed columns are read, I/O drops dramatically. This is called column pruning.

Furthermore, values in the same column share similar data types and values, so compression works far better. The amount column is all numbers and compresses efficiently, whereas mixed types interleaved row by row do not.

-- Athena cost is proportional to "the amount of data scanned"
-- CSV: even if you only need amount, every column gets scanned → expensive and slow
-- Parquet: only the amount column is scanned → cheap and fast
SELECT region, SUM(amount)
FROM orders          -- with Parquet, only the region and amount columns are read
GROUP BY region;

Conversely, workloads that "read or write an entire row," like OLTP, favor row-based storage — because columnar storage must gather multiple column blocks to reconstruct a single row.

💡 Related theory: Beyond column pruning, columnar formats also gain speed from predicate pushdown and partition pruning. Parquet stores statistics such as min/max per data block, so blocks that can't match a condition like WHERE amount > 500 are skipped entirely without being read. The combination of column pruning (reading less horizontally) + predicate pushdown (reading less vertically) is the heart of OLAP performance.

Why Parquet Is the De Facto Standard for Analytics

Parquet is the default recommended format across the AWS analytics stack (Athena, Redshift Spectrum, Glue, EMR). To summarize why:

  • Column pruning: reads only the needed columns, cutting I/O and cost (Athena bills by scan volume)
  • Strong compression: stores the same data far smaller than CSV → lower storage cost
  • Built-in statistics: per-block min/max enables predicate pushdown
  • Embedded schema: the file itself contains the schema, making it self-describing
# A common optimization: convert raw CSV/JSON to Parquet (Glue/Spark)
df = spark.read.json("s3://raw/events/")
df.write.partitionBy("year","month","day") \
        .parquet("s3://processed/events/")
# Athena queries then get faster and scan costs plummet

ORC has nearly the same columnar advantages as Parquet and is especially strong in the Hive/Hadoop ecosystem. Both are well supported on AWS, but Parquet is more widely used.

Avro and Schema Evolution

Avro is row-based binary, yet it is treated as important — because its core strength is schema evolution. Avro handles the schema explicitly alongside the data, and it is designed so that the reader's schema and the writer's schema remain compatible even when they differ. That's why it is used almost as a standard in streaming and event pipelines (Kafka, etc.) where schemas change frequently.

Schema evolution means safely handling the reality that data structures change over time. For example, a coupon_code field might later be added to order events. Both the old data and the new data must remain readable.

Compatibility types in schema evolution
  Backward compatible : new schema can read old data
                        → removing fields, adding fields with defaults
  Forward compatible  : old schema can read new data
                        → adding fields
  Full compatible     : both directions work

The principle of safe evolution: when adding a field, give it a default, and never casually delete or rename fields. With a default, reading old data that lacks the field simply fills in the default — nothing breaks.

💡 Related theory: The mechanism that enforces schema evolution at the organizational level is the Schema Registry. When a producer registers a new schema, it validates compatibility with the existing one, blocking compatibility-breaking changes before deployment. AWS Glue Schema Registry plays this role and integrates with Kinesis and MSK. It is a governance device that enforces data contracts in code.

Format Selection Decisions

Here is the flow for choosing a format on the exam and in practice.

Read directly by humans or exchanged externally?    → CSV / JSON
Loaded into S3 for analytics (aggregation)?         → Parquet (AWS default recommendation)
Hive/Hadoop-ecosystem-centric analytics?            → ORC
Streaming/events with frequent schema changes?      → Avro
Nested, semi-structured data (API responses, logs)? → JSON (→ convert to Parquet later)

The typical real-world pattern is "raw data arrives as JSON/CSV, but the processing stage converts it to Parquet and loads it into the analytics zone." This captures both the convenience of ingestion (text) and the efficiency of analysis (columnar).

Wrapping Up

Today's three key points. First, the essential difference between formats is columnar (Parquet/ORC) vs row-based (CSV/Avro), and for analytical queries, columnar — which reads only the columns — is overwhelmingly faster and cheaper. Second, Parquet is the de facto standard for AWS analytics, slashing Athena costs through column pruning, compression, and predicate pushdown. Third, schema evolution is about safely handling data structure changes; adding fields with defaults is the safe principle, and a schema registry enforces it.

In the next article, we weave together the fundamentals covered in Week 1 — roles and pipelines, batch/streaming, the service map, and data formats — for review.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

For an analytical query like `SELECT SUM(amount) FROM orders GROUP BY region`, what is the most fundamental reason a columnar format like Parquet is faster and cheaper than row-based?

Question 2

Raw logs are arriving in S3 as JSON. Given that frequent large-scale aggregation analysis with Athena is planned, what is the most effective optimization for the data engineer to take?

Question 3

In Kafka/streaming event pipelines where schemas change frequently, which row-based binary format is widely used for its write efficiency and schema evolution support?

Question 4

You are adding a `coupon_code` field to a live order event schema while keeping previously accumulated old data safely readable. What is the safest schema evolution approach?

Question 5

Which governance mechanism validates compatibility with the existing schema when a producer registers a new one, blocking compatibility-breaking changes before deployment?

PreviousA Bird's-Eye View of AWS Data ServicesWeek 1 · Day 3Next Week 1 Comprehensive ReviewWeek 1 · Day 5

On this page

  • The Five Formats at a Glance
  • Columnar vs Row-Based: The Essence of the Difference
  • Why Parquet Is the De Facto Standard for Analytics
  • Avro and Schema Evolution
  • Format Selection Decisions
  • Wrapping Up
  • Practice Questions