Amazon Kinesis and streaming choices

A stream is a replayable event log, not a work queue whose messages vanish after one consumer receives them. Start with analytics, IAM and S3.

Service boundaries

LessonPurpose
Kinesis Data StreamsEvent retention/replay with independently progressing consumers.
Amazon Data FirehoseManaged buffered delivery to supported destinations; firehose API name unchanged.
Managed Apache FlinkStateful continuous processing/windows with connector-specific delivery semantics.
MSKManaged Kafka for supported Kafka ecosystems.
Retired Kinesis SQLHistorical migration context only; SQL application deletion began January 27, 2026.

Partitioning, checkpoints and duplicates

A partition key directs records to shards; ordering is scoped to the supported shard/key behavior, not automatically global. Avoid hot keys and size sustained throughput by bytes and records. Consumers checkpoint progress independently; replay requires retention long enough for outages/backfills.

Kinesis and historical Kinesis SQL external delivery can produce duplicates. Flink state/checkpoints do not alone certify exactly-once effects in every external sink. Include event IDs, idempotent writes and connector-specific transaction/retry semantics in the design.

Buffered delivery versus processing

Firehose can transform through Lambda and perform supported JSON-to-Parquet/ORC conversion before delivery. Destination-specific buffering can include zero seconds where supported; S3 backup and dynamic partitioning have different restrictions. It is not a general arbitrary-language processing engine or a durable consumer checkpoint service.

Choose a direct stream consumer for custom replay/control, Firehose for managed delivery and Flink for stateful/event-time processing. Event sourcing requires durable retention/snapshots and domain semantics beyond simply selecting Kinesis.

Streaming exercise

Produce a small synthetic sequence with event IDs and event timestamps. Compare direct stream consumption with a delivery path into S3. Inject a repeated event and delayed event; verify ordering scope, observed duplicates and application idempotency.

Stop/restart a consumer in a sandbox and measure replay/lag from its checkpoint. Test unauthorized reading, monitor throttling/delivery failures and establish an explicit budget. Remove streams, consumers, delivery resources, output files and Flink/MSK compute created for the exercise.

Partition-key strategy and architecture comparisons

same customer key → stable partition mapping at a point in time
different consumers → independent checkpoints and processing lag
resharding/retries → ordering and duplicate handling remain explicit

Choose a key with enough distribution for sustained traffic while preserving the ordering the application actually needs. A single tenant key can become hot; randomizing every key can destroy useful per-entity order. Shard changes and producer retry strategies mean “globally ordered exactly once” is not a default stream property.

RequirementData StreamsFirehoseManaged Flink
Read from a chosen retained positionConsumer-controlledNo general consumer replay interfaceDepends on source/checkpoint/state configuration.
Custom consumer logicYour application/KCLSupported transform/delivery configurationStateful application with supported connectors.
Buffered storage deliveryBuild/configure a sinkManaged destination deliveryConnector/application responsibility.
Windowed event-time aggregationBuild a processorNot the central abstractionNatural supported use case.
Scaling responsibilityMode/shards and consumersService configuration/quotasApplication parallelism and state behavior.

For event sourcing, define the durable system of record and reconstruction process. Kinesis retention alone is not perpetual business history. For log aggregation, replayable input plus Firehose/S3 delivery gives different recovery options from direct Firehose-only ingress. Cost includes idle capacity/mode charges, retention, fan-out, dependent tables/metrics and downstream compute, not just event payload size.

References

Across the wiki