Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DVA-C03

Streaming data

DVA-C03 · Lesson 4 of 24 · 24:22

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DVA-C03 exam (AWS Certified Developer – Associate). In this lesson: Kinesis Data Streams shards, partition keys, ordering, retention, and capacity modes, enhanced fan-out, Lambda reading streams (batch size, window, parallelization, bisecting a batch, on-failure destinations), Amazon Data Firehose, and DynamoDB Streams. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Every click, in real time

Every tap in the AnyCompany Tickets app, a search, a seat view, a basket change, sends an event, and the team wants live dashboards, fraud alerts within seconds, and a copy of everything in S3. Events must stay in order for each fan, and a burst of millions of events must not be lost. This lesson covers streaming data: Kinesis Data Streams, Lambda as a stream consumer, Amazon Data Firehose, and DynamoDB Streams.

Streams and shards

A Kinesis data stream is made of shards. Each record carries a partition key, which picks its shard, so all the records of one fan stay in one shard, in order, with increasing sequence numbers. A shard accepts up to one megabyte or a thousand records per second for writes, and a hot partition key, which sends too much to one shard, causes throttling. In provisioned mode, you choose the number of shards, and in on-demand mode, the stream scales for you. Records stay in the stream for 24 hours by default, and up to 365 days, so consumers can read them again.

Consumers

Many applications can read the same stream, each at its own pace, which a queue cannot do. Standard consumers share the read throughput of each shard, two megabytes per second. Enhanced fan-out gives each registered consumer its own two megabytes per second per shard, pushed with low latency. And producers can send records one at a time with PutRecord, or in batches with PutRecords, which can partly fail, like any batch call.

Lambda and streams

Lambda reads streams through an event source mapping, which polls each shard and invokes the function with a batch of records. The batch size and the batching window trade latency for fewer invocations, and a parallelization factor, up to ten, processes several batches of one shard at once, still in order for each partition key. By default, a failing batch is retried until it succeeds or its records expire, and the shard stays blocked meanwhile, to keep the order. To unblock it, set a maximum number of retries or a maximum record age, split a failing batch in two, and send the details of discarded batches to an on-failure destination. And with partial batch responses, the function reports the first failed record, so only the records from that one are retried.

Firehose and DynamoDB Streams

Amazon Data Firehose delivers streaming data to destinations like Amazon S3, Amazon Redshift, OpenSearch Service, or an HTTP endpoint, with no consumer code. It buffers records by size or by time, can transform them with a Lambda function, and can convert JSON to columnar formats like Parquet, for Athena. DynamoDB Streams captures every change to the items of a table, for 24 hours, each record appearing exactly once, in order for each item. A Lambda function can react to those changes, like sending a confirmation when an order item becomes paid.

Choosing the tool

Choose the tool from the need. Custom real-time processing by several consumers, with replay, points to Kinesis Data Streams. Loading data into S3, a warehouse, or a search service, without writing consumers, points to Firehose. And reacting to changes in a DynamoDB table points to DynamoDB Streams, while a plain work queue, with no order or replay, stays with SQS.

Recap

Let's recap. Partition keys pick shards, keep each key's records in order, and must have many distinct values to avoid hot shards. Streams keep records for 24 hours by default, up to 365 days, and enhanced fan-out gives each consumer its own throughput. Lambda reads shards in batches, and a failing batch blocks its shard until retries or record age run out. Split batches, on-failure destinations, and partial batch responses keep the stream moving. And Firehose loads data with no code, while DynamoDB Streams reacts to table changes.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The producer uses the event type, like search or basket, as the partition key, and writes are throttled on one shard while the others are almost idle. Each fan’s events must stay in order. What should the developer change?

    • Add more shards to the stream
    • Use a random partition key for each record
    • Use the fan ID as the partition key
    • Raise the retention period of the stream
    Show the answer

    Use the fan ID as the partition key

    The fan ID has many distinct values, so it spreads the records across all shards, and keeps each fan's events in order. “Add more shards to the stream” would add shards, but every search event would still go to the same one. “Use a random partition key for each record” would scatter each fan's events, and break their order. And “Raise the retention period of the stream” would keep records longer, without spreading the writes.

  2. A Lambda function consumes a Kinesis stream, and one malformed record makes it fail. For hours, nothing else from that shard gets processed. What should the developer configure on the event source mapping?

    • Limited retries, batch splitting, an on-failure destination
    • A shorter batching window, to retry it more often
    • A larger batch size, to read more records at once
    • A dead-letter queue on the function, for failed events
    Show the answer

    Limited retries, batch splitting, an on-failure destination

    Limited retries, batch splitting, and an on-failure destination stop the bad record from blocking the shard, and keep its details for later. “A shorter batching window, to retry it more often” would retry the same failing record faster. “A larger batch size, to read more records at once” would only bring in more records, behind the blocked one. And “A dead-letter queue on the function, for failed events” is wrong, because a dead-letter queue on the function only covers asynchronous invocations, not stream polling.

  3. The analytics team wants every app event stored in S3 as Parquet files, every few minutes, to query with Athena, and no one wants to maintain consumer code. What should the developer use?

    • Kinesis Data Streams with a custom consumer
    • Amazon Data Firehose with format conversion
    • An SQS queue that keeps the app events
    • DynamoDB Streams on the events table
    Show the answer

    Amazon Data Firehose with format conversion

    Firehose buffers the events, converts them to Parquet, and writes them to S3, with no consumer code. “Kinesis Data Streams with a custom consumer” would need a consumer that writes and converts the files. “An SQS queue that keeps the app events” would store messages for a consumer to process, not files in S3. And “DynamoDB Streams on the events table” would record changes to a table, not app events.