Kinesis streams and partition keys
A durable stream or a queue?
A stream retains a sequence of events for a configured period, allowing independent readers to replay the same records. For a fictional shop, an order event can feed both a sales dashboard and a stock projection. A work queue is usually better for distributing independent jobs and acknowledging completed work; a scheduled batch is simpler when hourly or daily freshness is acceptable. Choose by latency, replay, consistency and cost, not by event volume alone.
Shard placement and ordering
Kinesis Data Streams divides records among shards, each with capacity and sequence positions. With user-managed partition keys, the key hash selects a shard. For order updates choose order_id so updates for one order share a key. This does not imply global order or event-time order; concurrent producers and retries can still reorder business events. A popular key can overload one shard even if others are idle. As of November 2026, supported on-demand streams also offer service-managed record distribution (AUTO), which ignores supplied keys and spreads records. Do not select AUTO when your design relies on key affinity. The example is a fictional event envelope, not an AWS request.
{ "event_id": "e1", "order_id": "o1", "version": 1, "amount_cents": 1200, "event_time": 100}Capacity, readers and retention
Provisioned mode requires planning shard capacity; on-demand mode manages shard capacity but still has quotas and scaling behavior. Shared-throughput readers compete for read capacity, whereas enhanced fan-out provides dedicated read throughput per registered consumer. Monitor throttles, incoming bytes and reader lag; retry only failed writes with bounded backoff and stable IDs. Retention determines how far back a reader can replay. Compare provisioned shard and write units against on-demand ingest/retrieval, retention and fan-out charges. On-demand Advantage has an account-level regional minimum commitment for ingest and retrieval; it is not automatically cheaper for a small lab. Check current regional rates and quotas before deployment.
Delivery to storage with Firehose
Amazon Data Firehose delivers buffered records to supported destinations such as S3. Buffer size and interval influence delivery latency; these are hints rather than a universal latency guarantee. Optional transformation and format conversion depend on destination and configuration. Delivery retries may duplicate records for some destinations; retain event IDs and reconcile counts. Monitor delivery freshness and failures, configure appropriate backup/error storage, encrypt data and restrict stream and destination access. Firehose is a delivery pipeline, not a general replayable consumer log.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Kinesis streams and partition keys — knowledge check
Reason about stream selection, processing guarantees and replay safety.
Which workload most benefits from a retained stream?
What can a hot partition key cause?
Which distribution option ignores producer partition keys?
What determines how far back records can be replayed?
What is Firehose primarily for?