Based on the DEA-C01 exam guideReport an error
The final piece of streaming ingestion is Amazon MSK (Managed Streaming for Apache Kafka). If Kinesis is AWS's proprietary streaming service, Kafka is the industry-standard open-source streaming platform, and MSK is the service in which AWS provides that Kafka as a managed offering.
The core question is the same as yesterday: "Kinesis exists, so why MSK? When do I use which?" Today we grasp Kafka's basic concepts (topics, partitions, consumer groups) and see exactly where it diverges from Kinesis. On DEA-C01 this comparison almost always appears.
In Kafka, data is classified by topic. Think of a topic as a "log per subject" (for example orders, clicks, sensor-data). Each topic is in turn split into several partitions. The partition is Kafka's unit of parallelism and throughput.
Topic: orders
├─ Partition 0: [msg0][msg1][msg2] ... ← append-only log, order guaranteed
├─ Partition 1: [msg0][msg1] ...
└─ Partition 2: [msg0][msg1][msg2][msg3] ...
As you may have noticed, the structure is nearly the same as KDS. Topic ≈ stream, partition ≈ shard. When a producer sends a message and specifies a key, that key determines which partition it goes to, and order is guaranteed within a single partition. This is identical to the partition key concept in KDS.
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers="b-1.msk.amazonaws.com:9092")
# The key (user-8821) decides the partition -> messages from the same user go to the same partition, order guaranteed
producer.send("orders", key=b"user-8821", value=b'{"item":"book","qty":2}')
producer.flush()💡 Related theory: Kafka and Kinesis both share the "distributed append-only log" model. Messages do not disappear when consumed (they are kept for the retention period), and multiple consumer groups read independently from their own offsets. In this respect both are fundamentally different from a traditional queue such as SQS. That is why someone with Kafka experience quickly understands Kinesis, and vice versa. The exam checks whether you know this "conceptual 1:1 mapping."
Consumers are bundled into consumer groups. Within one group, partitions are distributed among the consumers, so each partition is read by only one consumer in the group (parallel processing). Different groups each read the whole topic independently (fan-out).
Each consumer group records how far it has read as an offset. It is the same concept as a KDS checkpoint (which KCL stores in DynamoDB).
Topic orders (3 partitions)
├─ consumer-group-A (real-time payment processing) : partition0→C1, partition1→C2, partition2→C3
└─ consumer-group-B (data lake loading) : consumes the same topic separately with its own independent offsets
💡 Related theory: If the number of consumers exceeds the number of partitions, the excess consumers sit idle (because one partition is read by only one consumer in the group). So to raise throughput, you must provision enough partitions rather than just adding consumers. This is the same principle as in KDS, where adding consumers still limits parallelism if shards are insufficient. The formula "parallelism ceiling = number of partitions (shards)" applies to both.
MSK has AWS handle the provisioning, patching, and failure recovery of Kafka brokers and ZooKeeper (or KRaft). But you still have to be aware of and design the cluster, brokers, and partitions yourself. If you need fully serverless, MSK Serverless manages capacity automatically.
- MSK (Provisioned): You specify broker instance type and count, fine-grained control
- MSK Serverless : Automatic capacity, usage-based billing, minimal operational burden
- MSK Connect : Managed Kafka Connect (connect systems with source/sink connectors)
This is the key point of today.
| Criterion | Kinesis (KDS/Firehose) | Amazon MSK |
|---|---|---|
| Standard | AWS proprietary | Open-source Apache Kafka (higher portability) |
| Operational burden | Minimal (especially Firehose/On-demand) | Relatively large (cluster awareness required) |
| Existing assets | Suited to new AWS builds | When you already have Kafka code/team/ecosystem |
| Ecosystem | AWS integrations built in | Rich: Kafka Connect, Streams, third parties |
| Throughput | Per shard, On-demand automatic | Very high by tuning brokers/partitions |
The key decision criteria are simple.
The decisive keyword on the exam is "existing Apache Kafka workload/application." When this phrase appears, MSK is likely the answer. That is because you need to reuse the Kafka ecosystem (Kafka Connect, Kafka Streams, existing topic design, consumer code). Conversely, expressions like "minimal operational burden," "serverless," "AWS-native new build," or "simple S3/Redshift loading" point to Kinesis. Since the two services overlap in functionality, the answer is decided not by technical superiority but by "existing assets and operating model."
Here is how you send data that has entered MSK to the analytics stack. You load topic data into S3 with a sink connector of MSK Connect (for example the S3 Sink), or process it in real time with Lambda or Flink (Amazon Managed Service for Apache Flink) consuming Kafka and then send it downstream. As with KDS, the flow of "ingest → process → load" is the same.
With Kinesis, the service handles replication on its own, so there is no value for you to touch. In Kafka, you assemble durability through settings. Even though MSK is managed, the responsibility for these settings remains with you.
Topic orders, partition 0, replication factor 3
Broker 1 (AZ-a) : leader ← where producers and consumers attach
Broker 2 (AZ-b) : follower ← replicates by following the leader
Broker 3 (AZ-c) : follower
ISR (in-sync replicas) = the set of replicas keeping up with the leader in time
| Setting | Where | Meaning |
|---|---|---|
| Replication factor | Topic | How many brokers one partition is replicated to |
acks | Producer | 0 does not wait for a response / 1 succeeds once the leader writes it / all succeeds only when the whole ISR has written it |
min.insync.replicas | Broker/topic | When acks=all, the minimum number of replicas that must receive the write for it to count as successful |
min.insync.replicas=2 + producer acks=all. Even if one broker dies, writes continue, and an acknowledged message exists in at least two places.min.insync.replicas of 2 (for a 2-AZ cluster, 2 and 1 respectively). Automatic topic creation (auto.create.topics.enable) is off by default, and the default number of partitions is 1.acks=1, a message disappears if the leader receives it and dies before replicating. This is usually the cause in a passage saying "some messages are missing after a broker failure."Kafka used to keep cluster metadata in Apache ZooKeeper, and recent versions are moving to KRaft mode, in which a group of Kafka internal controllers manages it directly. MSK offers both approaches, and MSK operates the ZooKeeper nodes or KRaft controllers at no additional cost. On the exam you do not need "do I have to operate ZooKeeper myself?" but only the fact that "MSK operates it for you."
Not everything called "MSK" has the same operational burden.
| Category | Provisioned · Standard brokers | Provisioned · Express brokers | MSK Serverless |
|---|---|---|---|
| What you decide | Broker instance type and count, storage per broker | Broker instance type and count | Nothing (just create the cluster) |
| Storage | You provision it (up to 16,384 GiB per broker); auto scaling and tiered storage selectable | Managed by the service, billed for what you write, effectively unlimited | Managed by the service |
| Scaling | Rebalancing partitions is required after adding brokers | The same task is much faster than with Standard | Automatic |
| Control over Kafka settings | Widest | Best-practice settings are pre-applied and some are fixed | Limited |
| Authentication | IAM, SASL/SCRAM, mutual TLS | Uses the authentication methods of provisioned clusters (check the documentation by broker type and version for the detailed support scope) | IAM only (Kafka ACLs not supported) |
| Key limits | Depend on instance size | Throughput quotas by instance size | Cluster ingress 200 MB/s and egress 400 MB/s, ingress 5 MB/s per partition, maximum message 8 MiB |
| Suitable situation | Fine-tuning settings, keeping the same configuration as an existing cluster | When you want to reduce storage and scaling operations at high throughput | When traffic fluctuates widely and you do not want to do capacity planning |
With Kinesis, you just call the Regional endpoint with IAM and you are done. MSK has you connect to brokers inside a VPC, so you design networking and authentication separately.
| Method | Authentication | Authorization | Port (access from inside AWS) |
|---|---|---|---|
| Plaintext | None | — | 9092 |
| TLS (including mutual TLS authentication) | Client certificate | Kafka ACL | 9094 |
| SASL/SCRAM | Username and password (stored in Secrets Manager) | Kafka ACL | 9096 |
| IAM access control | IAM role or user | IAM policy (per topic and group) | 9098 |
9092 (plaintext) in the example in the body is for learning, and in production you use a port with in-transit encryption enabled.| Item | Kafka (MSK) partitions | Kinesis shards |
|---|---|---|
| Increase | Possible | Possible (split) |
| Decrease | Not possible (you must create a new topic and move over) | Possible (merge) |
| Key mapping when increasing | hash(key) % number of partitions changes, so the same key goes to a different partition | The hash range is split in half, so the parent → child relationship is preserved |
| Effect on ordering | Order of the same key can break before and after the increase | Preserved if you read the parent shard completely and then read the children |
retention.ms). You can also set a size-based limit (retention.bytes) alongside it.cleanup.policy=compact) is a feature Kinesis does not have. It deletes the old values of the same key and leaves only the latest value per key. It is for holding "the current state per customer" in a topic permanently while a new consumer reads from the beginning to restore the state.| Method | Direction | What it does | When to choose |
|---|---|---|---|
| MSK Connect (source connector) | External → topic | Puts a DB change log into a topic with a connector such as Debezium | Reusing existing Kafka Connect connectors, CDC into Kafka |
| MSK Connect (sink connector) | Topic → external | Exports to S3, OpenSearch, and so on | Using the connector ecosystem, fine control over format and partitioning |
| Data Firehose (MSK source) | Topic → S3, etc. | Loads without operating connectors | "Just accumulate the topic in S3" + minimal operations |
| Lambda event source mapping | Topic → function | Batch-unit invocation | Light per-record processing |
| Managed Service for Apache Flink | Topic ↔ topic/sink | Stateful real-time aggregation and joins | Window operations |
| Glue streaming ETL | Topic → S3/JDBC | Spark micro-batch | Reusing existing Glue code |
| Redshift streaming ingestion | Topic → materialized view | Ingests directly without going through S3 | Querying the warehouse at low latency |
| MSK Replicator | Cluster → cluster | Replication between MSK provisioned clusters in the same Region or different Regions | Disaster recovery, cross-Region data sharing |
| Axis | Kinesis Data Streams | Amazon MSK |
|---|---|---|
| Capacity unit | Shard (write 1 MB/s and 1,000 records/s, read 2 MB/s) | Broker size × count, partitions |
| Durability settings | None (managed by the service) | You set replication factor, acks, min.insync.replicas |
| Retention | 24 hours to 365 days | Per configuration (effectively indefinite possible), compaction supported |
| Consumption model | Shared throughput / enhanced fan-out (limit on registered consumers) | Consumer groups (limits on the number of groups are much looser) |
| Shrinking | Shards can be merged | Partitions cannot be reduced |
| Access | Regional API endpoint + IAM | Brokers inside a VPC + IAM/SCRAM/TLS |
| Billing structure | Shard hours or data volume | Broker hours + storage (usage for Serverless) |
| Ecosystem | AWS service integrations built in | Kafka Connect, Kafka Streams, third-party tools |
| Passage clue | Correct answer | Reason |
|---|---|---|
| "Existing Kafka application without code changes" | MSK | Kafka API compatible |
| "Kafka compatible + without capacity management" | MSK Serverless | Automatic scaling |
| "Existing Kafka Connect connectors without operational burden" | MSK Connect | Managed Kafka Connect |
| "Load an MSK topic into S3 without code" | Data Firehose (MSK source) | Managed loading |
| "No message loss even on broker failure" | Replication factor 3 + acks=all + min.insync.replicas=2 | Confirmed by at least two replicas |
| "Added consumers but throughput is unchanged" | Increase the number of partitions | Parallelism ceiling = number of partitions |
| "Keep only the latest state per key" | Log compaction topic | Retains the last value for each key |
| "Replicate topics to another Region (DR)" | MSK Replicator | Cluster-to-cluster replication |
| "Control topic access with IAM roles" | IAM access control | No separate credentials needed |
| "New build, no Kafka experience, only S3/Redshift loading" | Data Firehose | MSK is overkill |
Tomorrow we tie the four batch services and three streaming services learned this week into a single decision map for review.
Click a choice to reveal the answer and explanation.
Question 1
A company has run streaming pipelines on Apache Kafka for years on-premises and wants to move existing consumer/producer code and Kafka Connect connectors to AWS with minimal changes. Which service is most appropriate?
Question 2
How does a Kafka partition most closely correspond to which Kinesis concept?
Question 3
A Kafka topic has 3 partitions and you consume it with 5 consumers in the same group. What happens?
Question 4
You're building a new streaming pipeline on AWS wanting minimal operations. Data only needs to load to S3 and Redshift. You have no Kafka experience or existing assets. What's the best choice?
Question 5
What fundamental characteristic do Kafka and Kinesis share that traditional message queues like SQS lack?