Amazon Kinesis Data Streams
🔍 Explanation
Let’s match the requirements one by one:
| Requirement | Needed Feature | Why Kinesis Data Streams fits |
|---|---|---|
| Sub-second ingestion | Low-latency, high-throughput streaming | Kinesis Data Streams can ingest data in milliseconds. |
| Guaranteed ordering per session | Partition key–based ordering | Kinesis guarantees record order within a shard (partition key). |
| Replay historical events | Data retention up to 7 days (configurable) | You can reprocess/replay events later by re-reading from the stream. |
🧠 How It Works
1. Producers
Your clickstream or app servers send session events (with a partition key like session_id) to Kinesis Data Streams in real time.
2. Stream Storage
Kinesis stores ordered data in shards; each shard maintains the sequence for its partition key.
3. Consumers
Downstream consumers — such as Lambda functions, Managed Service for Apache Flink, or custom apps — can process data to update embeddings in real time.
4. Replay
If needed, you can re-read (replay) data from the stream using sequence numbers.
🚫 Why Not the Others?
| Option | Why Not Suitable |
|---|---|
| Amazon Kinesis Data Firehose | Good for delivery to S3 or Redshift, but no ordering or replay capability. |
| Amazon MSK | Also meets the requirements, but higher operational overhead (brokers, scaling, maintenance). Kinesis offers simpler fully managed experience. |
| Amazon SQS | Doesn’t guarantee ordering per session or replay capability. |
| Amazon SNS | Not designed for streaming or ordered replay; best for pub/sub notifications. |
🧭 Summary
| Feature | Kinesis Data Streams | Firehose | MSK | SQS |
|---|---|---|---|---|
| Sub-second latency | ✅ | ⚠️ (buffered) | ✅ | ⚠️ |
| Ordering per session | ✅ (per shard) | ❌ | ✅ | ⚠️ (FIFO only, limited scale) |
| Replay capability | ✅ | ❌ | ✅ | ❌ |
| Managed service | ✅ Fully managed | ✅ | ⚠️ Partially managed | ✅ |
| Best fit for GenAI embedding updates | ✅ | ❌ | ⚠️ (more ops) | ❌ |
✅ Final Answer:
Amazon Kinesis Data Streams — it provides sub-second ingestion, guaranteed ordering per session, and event replay capabilities.