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 2
DEA-C01· AssociateWeek 1 · Day 2~18 min read

Day 2 - Batch vs Streaming

Even with the same data, system design changes completely depending on "when and how much" you process. Gathering a full day's orders every night to produce a settlement report versus catching a fraudulent transaction the moment a payment happens — both deal with the same payment data, but they require entirely different machinery. The former is batch, the latter is streaming.

Today we look at the essence of these two processing paradigms, the cases each is suited for, and the core trade-off that divides them: latency and throughput. When designing a new pipeline, the very first judgment a data engineer makes is "is this batch or stream."

The Essence of the Two Paradigms

The difference is whether you process data in bundles or as it arrives.

Batch
  [····· collect ·····] → process at once → result
  Bounded data, runs on a fixed schedule

Streaming
  → arrive → process → arrive → process → arrive → process →
  Unbounded data, flows continuously

Batch handles a finite bundle — "whatever accumulated over the past hour/day." It has a clear beginning and end. Streaming handles an infinite flow — "events arriving from now until forever." Since there is no end, producing a result requires cutting the flow with a time window, such as "the last 5 minutes."

AspectBatchStreaming
DataBoundedUnbounded
ExecutionPeriodic (hourly/daily)Continuous (always on)
LatencyMinutes to hoursMilliseconds to seconds
ThroughputVery highPer-event processing
AWS ExamplesGlue, EMR, BatchKinesis, MSK, Flink

💡 Related theory: The most important concept in streaming is windowing. To aggregate over an infinite flow, you must cut the flow into time units. The main types are tumbling windows (fixed, non-overlapping intervals), sliding windows (overlapping, moving), and session windows (separated by gaps in activity). Handling the difference between "when the event occurred (event time)" and "when the system received it (processing time)" is also a core challenge of streaming design.

When to Use Each

There is only one selection criterion: how fresh do the results need to be.

When batch fits:

  • Jobs with fixed schedules, like month-end settlement or daily revenue reports
  • Reprocessing large volumes of historical data (backfill)
  • Analyses where results can safely be minutes to hours late
  • Preparing large-scale training data for machine learning models

When streaming fits:

  • Real-time anomaly and fraud detection
  • Live dashboards, real-time monitoring and alerting
  • Immediate processing of IoT sensor data
  • Recommendations and personalization that must react instantly to user behavior
# Batch: collect a day's logs and aggregate at once (Glue/Spark)
df = spark.read.parquet("s3://logs/date=2026-06-25/")  # the entire day
daily = df.groupBy("region").agg(sum("amount"))
daily.write.parquet("s3://reports/daily/2026-06-25/")
 
# Streaming: aggregate flowing events in 5-minute windows (Flink/KDA)
events.window(TumblingWindow.of(minutes=5)) \
      .key_by("region") \
      .aggregate(SumAggregator())  # emits results every 5 minutes, endlessly

The key point is that "real time is expensive." Streaming demands always-on infrastructure and more complex operations. So asking "do we really need real time, or is 5 minutes late acceptable" is the starting point of cost optimization. Vaguely deciding "fresher data is better, so stream everything" makes cost and complexity explode.

💡 Related theory: Micro-batch is the midpoint between the two. Like Spark Structured Streaming, it repeatedly runs small batches at very short intervals (a few seconds) to achieve "near real time." It is simpler to operate than true per-event streaming while achieving second-level latency, so many real-world pipelines choose this compromise.

The Latency-Throughput Trade-Off

These are the two metrics that quantitatively separate batch from streaming.

  • Latency: the time from when data is generated until a result comes out. The lower it is, the closer to "real time."
  • Throughput: the amount of data that can be processed per unit of time. The higher it is, the stronger the system is at "high volume."
Batch   : high latency ↑   very high throughput ↑↑↑
Stream  : low latency ↓    per-event processing → lower cumulative throughput

Batch collects data and processes it all at once, so per-record overhead is amortized and throughput is overwhelmingly high. In exchange, latency accrues for as long as you collect. Streaming processes each event the moment it arrives, so latency is very low, but every event carries processing and delivery costs, making the cumulative throughput achievable on the same infrastructure lower than batch.

On top of this comes the axis of correctness. Streaming must handle late-arriving data and out-of-order events, so it has to compromise between "accurate final results" and "fast approximate results." Batch processes after all the data has arrived, so it is free from this problem.

        Correctness ↑
          │
  Batch ● │
          │      ● Micro-batch
          │
          │            ● Streaming
          └──────────────────→ Freshness (low latency) ↑

💡 Related theory: The classic architecture-level solution to this trade-off is the Lambda Architecture. It runs a batch layer (accurate but slow) and a speed layer (fast but approximate) simultaneously, merging them in a serving layer. Because of the burden of maintaining two copies of the code, the Kappa Architecture — which handles even batch with a single streaming engine — emerged as an alternative. On AWS, the Kinesis/MSK + Flink combination corresponds to Kappa.

Mapping to AWS

This is the baseline for the exam's frequent "which service would you use for this scenario" questions.

ParadigmIngestionProcessingTypical Scenarios
BatchS3 loading, DataSyncGlue, EMR, AWS BatchDaily reports, large-scale ETL
StreamingKinesis Data Streams, MSKKDA (Flink), LambdaReal-time detection, live dashboards
Near real-timeKinesis Data FirehoseFirehose transforms, LambdaLoading logs into S3/Redshift almost immediately

In particular, keep two easily confused services straight. Kinesis Data Streams is for true streaming that needs low latency and multiple consumers, while Kinesis Data Firehose is a "managed near-real-time delivery service" that receives a stream and automatically loads it into S3, Redshift, and other destinations. If you just want data dropped at a destination without operating consumer code yourself, it's Firehose.

Wrapping Up

We established three judgment criteria today. First, batch processes bounded data periodically, while streaming processes an unbounded flow continuously. Second, the selection criterion is "how fresh do the results need to be," and since real time is expensive, don't default to streaming blindly. Third, batch is strong in throughput and correctness, streaming is strong in low latency — and micro-batch is the compromise between them.

In the next article, we unfold the full map of AWS data services that actually implement these processing paradigms, organized into ingestion, storage, processing, analytics, and governance categories.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

In streaming processing that deals with an unbounded data flow, which concept is indispensable for producing aggregation results from an infinite flow?

Question 2

Which processing paradigm is best suited for "collecting a full day's transactions every night to generate a settlement report," and why?

Question 3

What is the fundamental reason batch processing achieves higher throughput per unit of time than streaming?

Question 4

Which AWS service is best suited when you want stream data automatically loaded into S3 or Redshift almost immediately, without operating separate consumer code?

Question 5

Which classic architecture resolves the latency-correctness trade-off by operating a batch layer (accurate but slow) together with a speed layer (fast but approximate)?

PreviousWhat Is Data EngineeringWeek 1 · Day 1Next A Bird's-Eye View of AWS Data ServicesWeek 1 · Day 3

On this page

  • The Essence of the Two Paradigms
  • When to Use Each
  • The Latency-Throughput Trade-Off
  • Mapping to AWS
  • Wrapping Up
  • Practice Questions