MSK and managed stream processing
Kafka with Amazon MSK
Amazon Managed Streaming for Apache Kafka (MSK) manages Kafka infrastructure. A topic contains partitions; each record has an offset within its partition. In a conventional consumer group, one active group member owns a partition at a time, while different groups can read independently. For four partitions, six conventional group consumers leave at least two without partition assignments. Kafka share groups are a distinct supported feature on eligible MSK versions and configurations; do not apply the conventional assignment rule to them. Commit offsets only after the required durable processing succeeds. Compare broker or serverless capacity, storage, transfer and client operations.
Stateful processing with Flink
Managed Service for Apache Flink runs stateful stream processing. A keyed operator can keep totals per order or customer; a window groups events over time. Checkpoints capture recoverable processing state and source progress; snapshots support planned restoration. Exactly-once state recovery does not guarantee exactly-once external writes: source replay and sink transaction or idempotency support matter. Pin a supported Flink runtime and connector versions and test upgrade/restore compatibility. A local Python model is not a Flink runtime.
Select processing and orchestration
Use Glue streaming ETL for Spark-based continuous transformation, commonly micro-batches with checkpoint progress. EMR can run Spark workloads when you need more control over engines and execution. Amazon Managed Workflows for Apache Airflow (MWAA) coordinates tasks in a dependency graph, for example daily validation after an S3 delivery. Airflow schedules and coordinates work; it does not replace a low-latency event processor. A possible architecture is Kinesis to Firehose to S3, followed by scheduled validation; use Flink instead for continuous stateful alerts and MSK when Kafka compatibility is central.
Event time and late records
Event time is when an event happened; processing time is when the engine handles it. A watermark estimates event-time progress, not a promise that older events cannot arrive. In a simplified model, max observed time 120 minus tolerance 10 gives watermark 110. An event at 105 is late under that model. Decide whether to correct aggregates, route late events to a separate store or drop them with an explicit metric. Real Flink combines watermarks across inputs and supports idleness and operator-specific late-data policies. Monitor lag, checkpoint duration and sink throughput.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
MSK and managed stream processing — knowledge check
Reason about stream selection, processing guarantees and replay safety.
Four partitions and six conventional group consumers implies what?
Which capability suits continuous keyed event totals?
What is the role of MWAA?
What does a checkpoint protect?
Max event time 120 and tolerance 10 gives which simplified watermark?