Streaming architectures Kiến trúc streaming
Pick-the-right-tool cheat sheet across KDS, Firehose, Managed Flink, MSK, plus DynamoDB Streams and the messaging services. The interactive builder below encodes the real AWS constraints — try to build a pipeline that violates one and it tells you why.
Cheat sheet chọn đúng tool giữa KDS, Firehose, Managed Flink, MSK, và DynamoDB Streams cùng service messaging. Builder tương tác bên dưới mã hoá đúng ràng buộc AWS thật — thử build pipeline sai để xem lý do.
Interactive pipeline builderBuilder pipeline tương tác
Pick a source, then chain the ingest, processor, and sink. Options that would break a real AWS constraint go grey — hover to see why. Chọn nguồn, sau đó nối ingest, processor, sink. Lựa chọn vi phạm ràng buộc AWS sẽ mờ đi — hover để xem lý do.
Comparison chartBảng so sánh
One glance across the messaging + streaming + storage services. Exam questions often key on one row. Một cái nhìn qua các service messaging + streaming + storage. Câu hỏi thi thường chốt ở 1 dòng.
| KDS | SQS | SQS FIFO | SNS | DynamoDB | S3 | |
|---|---|---|---|---|---|---|
| DataDữ liệu | Immutable | Immutable | Immutable | Immutable | Mutable | Mutable |
| RetentionRetention | 1–365 d, export via KDF | 1–14 d | 1–14 d | NoneKhông | Infinite (or TTL)Vô hạn (hoặc TTL) | Infinite, lifecycle rulesVô hạn, lifecycle |
| OrderingOrdering | Per shardTheo shard | NoneKhông | Per group-idTheo group-id | NoneKhông | NoneKhông | NoneKhông |
| ScalabilityScalability | Provision shards / on-demandProvision shard / on-demand | Soft limitSoft limit | 300 msg/s · 3,000 batched | Soft limitSoft limit | WCU/RCU or on-demand | 3,500 PUT / 5,500 GET per prefix |
| ReadersReader | EC2, Lambda, KDF, Flink, KCL | EC2, Lambda | EC2, Lambda | HTTP, Lambda, Email, SQS, KDF | DynamoDB Streams | SDK, S3 Events |
| LatencyLatency | KDS ~200 ms · Enhanced ~70 ms · KDF ~1 min | 10–100 ms | 10–100 ms | 10–100 ms | 10–100 ms | 10–100 ms |
Playbook patternsPattern playbook
1. Log lake (agent → S3)1. Log lake (agent → S3)
Kinesis Agent → Firehose → S3 (Parquet). Zero code, near-real-time, cheapest way to get logs onto Athena. Kinesis Agent → Firehose → S3 (Parquet). Không code, gần real-time, rẻ nhất để đưa log lên Athena.
2. Real-time analytics2. Analytics real-time
KDS → Managed Flink → OpenSearch (dashboards) + KDF → S3 (raw archive). Flink handles windowed aggregations; Firehose runs alongside for durable storage. KDS → Managed Flink → OpenSearch (dashboard) + KDF → S3 (archive gốc). Flink lo aggregate theo window; Firehose chạy song song để lưu bền.
3. Change data capture (DynamoDB)3. CDC từ DynamoDB
Table → DynamoDB Streams → Lambda (24 h retention, per-shard order). Need longer retention or replay? Toggle "Kinesis Data Streams for DynamoDB" and consume from KDS instead. Table → DynamoDB Streams → Lambda (retention 24 h, order theo shard). Cần retention dài hơn hoặc replay? Bật "Kinesis Data Streams for DynamoDB" và consume qua KDS.
4. Kafka team, AWS backbone4. Team Kafka, xương sống AWS
Producers → MSK → Lambda / Flink for processing + MSK → Firehose → S3 for archive. Native MSK-to-Firehose (2023) removed the old MSK Connect worker. Producer → MSK → Lambda / Flink để xử lý + MSK → Firehose → S3 để archive. MSK-to-Firehose native (2023) đã thay MSK Connect worker cũ.
5. SNS "archive everything"5. SNS "archive mọi thứ"
SNS → Firehose → S3. Native SNS-to-KDF subscription, no Lambda in the middle. Great for capturing every message that flows through a topic. SNS → Firehose → S3. Subscription SNS-to-KDF native, không cần Lambda. Hợp để giữ mọi message chảy qua topic.
Constraints the exam lovesRàng buộc thi hay hỏi
- Nothing reads from Firehose. Not KCL, not Spark, not Flink, not a Lambda ESM. Firehose is push-only into its fixed sink list.Không gì đọc được từ Firehose. Không KCL, không Spark, không Flink, không Lambda ESM. Firehose chỉ push vào danh sách sink cố định.
- KDF sinks are fixed: S3, Redshift (via S3 COPY), OpenSearch, Splunk, HTTP endpoint, third-party partners. No KDS, no MSK, no DynamoDB, no RDS as a KDF sink.Sink KDF là cố định: S3, Redshift (qua S3 COPY), OpenSearch, Splunk, HTTP endpoint, partner. Không có KDS, MSK, DynamoDB, RDS.
- Managed Flink reads only KDS or MSK. Not KDF, not SQS, not S3-object-stream.Managed Flink chỉ đọc KDS hoặc MSK. Không KDF, không SQS, không S3-object-stream.
- Lambda ESM sizing: for KDS = one concurrent invocation per shard (parallelization factor up to 10 breaks strict per-shard ordering). For MSK = one per partition.Lambda ESM sizing: KDS = 1 invocation đồng thời/shard (parallelization factor tới 10 phá ordering trong shard). MSK = 1/partition.
- Firehose "sub-second" is a lie — buffer min is 60 s in the console for most sinks; only S3 sink supports the 0-second zero-buffer mode.Firehose "sub-second" là ảo — buffer tối thiểu 60 s trên console cho hầu hết sink; chỉ sink S3 có mode 0 giây.
- Parquet/ORC conversion works only when the sink is S3, and needs a Glue Data Catalog table for the schema.Parquet/ORC conversion chỉ khi sink là S3, và cần bảng Glue Data Catalog cho schema.