Skip to main content

Amazon MSK - Overview

Amazon MSK (Managed Streaming for Apache Kafka) is AWS's fully managed solution for open-source Apache Kafka, giving you real-time event streaming pipelines without the massive headache of manually patching, scaling, and maintaining Kafka brokers!

While both Amazon Kinesis Data Streams and Amazon MSK solve the real-time streaming puzzle, the DVA-C02 exam heavily tests architectural trade-offs, configuration limits, and ingestion/consumption patterns between the two services.


Key Takeawaysโ€‹

Let's go over the MSK architecture, scaling mechanics, consumption integration points, and the Kinesis vs. MSK comparison matrix.

๐Ÿ—๏ธ Core Architecture & Deployment Optionsโ€‹

Amazon MSK deploys Kafka brokers across up to 3 Availability Zones (AZs) inside your private VPC for high availability:

  • MSK Provisioned: You choose the EC2 broker instance types (e.g., kafka.m5.large) and allocate EBS storage volumes per broker. Data is stored persistently on EBS for as long as you configured.
  • MSK Serverless: Automatically provisions capacity, scales brokers, and manages storage on demand based on application throughputโ€”zero server management required!
  • Metadata Consensus Note (KRaft vs. ZooKeeper) ๐Ÿง : Upstream Apache Kafka 4.0 removes ZooKeeper entirely in favor of KRaft (Kafka Raft) consensus. Modern MSK clusters run KRaft controllers managed transparently by AWS behind the scenes at no extra cost!

โš”๏ธ Amazon Kinesis Data Streams vs. Amazon MSK (The Exam Showdown)โ€‹

When DVA-C02 questions present real-time streaming requirements, use this side-by-side comparison matrix to immediately pick the right target:

Architectural Metric๐ŸŒŠ Amazon Kinesis Data Streams๐ŸŽธ Amazon MSK (Apache Kafka)
Message Payload SizeStrict 1 MB limitDefault 1 MB, configurable up to 10 MB+
Partitioning ConceptShardsTopics with Partitions
Scaling MechanismShard Splitting (scale up) & Merging (scale down)Add Partitions (cannot remove partitions!)
Retention Period24 hours up to 365 days maxUnlimited (constrained only by EBS storage budget)
Protocol CompatibilityAWS SDK / KPL / KCL APIsStandard Apache Kafka APIs (Zero vendor lock-in)
SecurityTLS in-flight & KMS at-rest encryptionPLAINTEXT or TLS in-flight and KMS at-rest encryption

๐Ÿ”Œ Producing & Consuming from MSKโ€‹

๐Ÿ“ฅ PRODUCERS ๐ŸŽธ MSK CLUSTER ๐Ÿ“ค CONSUMERS
(Kinesis, IoT, App Code) โ”€โ”€โ–บ [ Topic / Partitions ] โ”€โ”€โ–บ โšก AWS Lambda (Event Source)
๐ŸŒŠ Managed Flink (Kinesis Analytics)
๐Ÿงน AWS Glue Streaming ETL
๐Ÿ’ป Custom App (EC2 / ECS / EKS)

A. Producing Data:โ€‹

Standard Kafka Producers, Debezium Change Data Capture (CDC) connectors, or custom applications write to MSK topics using standard Kafka client libraries.

B. Consuming Data (Key Exam Targets):โ€‹

  1. AWS Lambda: Configured directly as an Event Source Mapping (MSK trigger). Lambda automatically manages polling batches and scaling workers.
  2. Amazon Managed Service for Apache Flink (formerly Kinesis Data Analytics): Stateful real-time stream processing applications running native Flink SQL or Java/Scala code.
  3. AWS Glue: Real-time Streaming ETL jobs powered by Apache Spark Streaming.
  4. Custom Kafka Consumers: Self-managed application containers deployed on Amazon EC2, ECS, or EKS using native Kafka client SDKs.


Exam Tipsโ€‹

  • The >1 MB Message Size Requirement ๐Ÿšจ: If a scenario states an application streams messages larger than 1 MB (e.g., 5 MB payloads) that exceed Kinesis limitsโ€”choose Amazon MSK with custom message size configuration.
  • Existing Kafka Application Migration ๐Ÿšš: If an enterprise wants to migrate an existing open-source Apache Kafka workload to AWS without rewriting application producer/consumer code or changing APIsโ€”select Amazon MSK!
  • Partition Scaling Direction: Remember that while Kinesis shards can be split and merged, Kafka topic partitions can only be addedโ€”you cannot decrease the partition count on a topic without recreating it!