Designing a Streaming Pipeline
This lesson explains the reference streaming pipeline, which processes events within seconds of their creation for uses such as fraud detection, live metrics and operational alerts, and how most exam scenarios are variations of it.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the stages of the reference streaming design.
- Simplify the design when requirements allow.
- Address design concerns such as partition keys and late data.
The reference design
Producers → Kinesis Data Streams (or MSK) → Managed Service for Apache Flink or Lambda → Firehose → S3 (and OpenSearch for search).
Each stage does one job. Kinesis Data Streams or MSK receives events and holds them durably, in order and for a retention period, so several consumers can read them independently and replay them after a failure. Managed Service for Apache Flink, or Lambda for simpler logic, processes events within seconds: computing windowed aggregations, enriching records and raising alerts.
Amazon Data Firehose delivers the results, batching records, converting them to Parquet and writing them to partitioned S3 prefixes, OpenSearch or Redshift. The data then serves two purposes: S3 keeps the history for analytics, while OpenSearch or Redshift streaming ingestion supports search and near-real-time dashboards. The following table summarises the stages.
| Stage | Service | Role |
|---|---|---|
| Ingestion | Kinesis Data Streams or MSK | Durable, ordered, replayable buffer with several consumers |
| Processing | Managed Service for Apache Flink, or Lambda | Windows, aggregations, enrichment and alerts in seconds |
| Delivery | Amazon Data Firehose | Batching, format conversion and partitioned delivery to S3, OpenSearch or Redshift |
| Storage and serving | S3, OpenSearch, Redshift streaming ingestion | History for analytics; search and dashboards |
The following diagram shows a fraud scoring pipeline's stream and its two consumers.

The streaming reference design
Simplifying when requirements allow
Every extra stage adds cost and operational work, so a narrower requirement deserves a simpler design. If events only need to land in S3 within minutes as Parquet, Firehose alone receives, converts and delivers them, with no stream or processing code. If analysts need to query the stream in Redshift within seconds, Redshift streaming ingestion reads Kinesis or MSK directly into a materialised view. If each record needs only simple processing on its own, Lambda consumers on a Kinesis stream are enough, without Flink. The following table summarises these simpler designs.
| Requirement | Simpler design |
|---|---|
| Land events in S3 within minutes as Parquet | Firehose alone |
| Query a stream in Redshift within seconds | Redshift streaming ingestion from Kinesis or MSK |
| Simple per-record processing | Kinesis with Lambda consumers |
The following diagram matches each narrower requirement to its simpler design.

Simpler streaming designs
Design concerns
Streaming pipelines raise design concerns that batch pipelines do not. The partition key determines both ordering and load: records with the same key are processed in order, so the key must preserve the ordering the business needs, such as all events for one account, while spreading load evenly across shards or partitions.
Most streams deliver records at least once, so consumers must be idempotent or deduplicate records. Events can arrive late or out of order, which is handled with event-time windows and watermarks rather than processing-time windows. Finally, the pipeline's health is monitored through consumer lag, such as Kinesis iterator age or Kafka consumer lag, which shows whether processing keeps up with incoming data.
Streaming design concerns
Real-time fraud scoring
A payments company must flag suspicious card activity within five seconds and keep every event for analysis.
Transactions are written to Kinesis Data Streams keyed by card ID, so each card's events stay in order. A Flink application computes per-card spending over sliding five-minute windows and publishes alerts to EventBridge. Firehose, as a second consumer, converts the events to Parquet and writes them to S3 partitioned by date for Athena. Firehose alone would not meet the five-second requirement, because it buffers.
When is Firehose alone enough for a streaming pipeline?
Show answer
When the only requirement is to land data in S3 within minutes, with no custom processing.
Exam Tips
Remember for the exam
- Streaming: Kinesis or MSK → Flink or Lambda → Firehose → S3.
- If the only requirement is to land data in S3 within minutes, Firehose alone is enough.
- Use partition keys that keep related events in order.
- Streaming consumers must handle at-least-once delivery.