VAYULearn
Colour theme
Investigate a failure
VAYU Learn

AWS Data Engineering

AWS MSK: Running Kafka Without Managing Kafka

DataForge AWS Data Engineering Series - Blog 9 of 20

AWS Data EngineeringKafka & Streaming

The migration plan looked simple on the whiteboard: move from self-managed Kafka on EC2 to MSK, same topics, same consumer groups, same producer code, just let AWS handle the brokers. Three weeks later, the team was still debugging why consumer lag spiked every time MSK performed automatic broker maintenance — something their self-managed cluster never did on its own schedule.

Nobody had misconfigured MSK. MSK was doing exactly what managed infrastructure does: patching and replacing brokers according to AWS’s maintenance windows, not the team’s release calendar. The self-managed cluster had never forced this because the team controlled when maintenance happened. MSK does too — but the default behavior isn’t “never,” it’s “AWS decides unless you configure otherwise,” and nobody had configured otherwise before the migration.

This is the recurring lesson with “managed” services throughout this series: managed doesn’t mean zero operational awareness required. It means the operational awareness shifts to different things — not whether brokers need patching, but when AWS is allowed to patch them, and whether your consumer applications tolerate the brief disruption that causes.

Let’s go deep.


TL;DR

MSK (Managed Streaming for Apache Kafka) is genuine Apache Kafka — the same protocol, the same client libraries, the same consumer group semantics — with AWS managing broker provisioning, patching, and infrastructure scaling. The value proposition is real for teams with existing Kafka investment or needing Kafka-specific capabilities Kinesis doesn’t replicate. The operational reality is that “managed” shifts responsibility rather than eliminating it — maintenance windows, partition planning, and MSK Connect configuration all require deliberate decisions that self-managed Kafka veterans sometimes assume AWS has made for them.

By the end of this article you’ll be able to:

  • Explain what MSK actually manages versus what remains your responsibility
  • Configure maintenance windows and understand their operational impact on consumers
  • Use MSK Connect correctly for the Kafka Connect ecosystem, including the specific connector patterns for data engineering
  • Make the concrete decision between MSK and Kinesis for a new pipeline, building on Blog 8’s foundation

Series context: This is the direct counterpart to Blog 8 (Kinesis). Both build on IAM (Blog 3) and VPC networking (Blog 4) — MSK in particular, since it runs directly inside your VPC the same way EMR does (Blog 4’s comparison).

AWS patches a broker. Kafka detects it. The consumer group rebalances. Consumption pauses. Nothing is broken - this is routine Kafka coordination, unfamiliar only to teams who never saw it on a schedule they didn’t control.

What MSK Actually Manages

MSK’s value proposition is precise, and understanding exactly where the management boundary sits prevents both over-trusting and under-trusting the service.

What MSK manages for you:
Broker provisioning and initial configuration
Broker patching and version upgrades (with your
input on timing via maintenance windows)
Broker replacement on hardware failure
ZooKeeper/KRaft controller management (the
coordination layer Kafka depends on)
Storage scaling (with auto-scaling storage as
an option)
Encryption in transit and at rest configuration
What remains YOUR responsibility:
Topic creation, partition count, and replication
factor decisions
Consumer group design and rebalancing behavior
Producer/consumer application code
Monitoring consumer lag and broker-level metrics
Capacity planning (broker instance type and count)
MSK Connect connector configuration and monitoring
Security group and network ACL rules (Blog 4's
concepts, applied to MSK's broker ENIs)

The line that matters most operationally: MSK manages the infrastructure Kafka runs on. It does not manage how you use Kafka — partition strategy, consumer group design, and topic configuration remain entirely your decisions, made with the same care they’d require on self-managed Kafka.


Partitions: The Same Concept as Kinesis Shards, Different Mechanics

Kafka partitions serve a similar structural role to Kinesis shards (Blog 8) — the unit of parallelism — but the mechanics and failure modes differ in ways that matter.

Kinesis shard (Blog 8):
Fixed throughput ceiling: 1MB/s write, 2MB/s read
Exceeding it: explicit throttling exception
Resharding: explicit split/merge operations
Kafka partition (MSK):
No hard throughput ceiling per partition - throughput
is bounded by broker resources (CPU, disk I/O, network),
shared across all partitions on that broker
Exceeding broker capacity: increased latency and
potential backpressure, not a clean throttling exception
Rebalancing: adding partitions to a topic is possible,
but existing message ordering guarantees only apply
WITHIN a partition - adding partitions changes how
future messages with existing keys may be distributed

The consequence that catches Kafka newcomers: unlike a Kinesis shard’s clean throughput ceiling, a Kafka partition’s practical throughput limit is determined by the broker it lives on, shared with every other partition on that broker. A partition that seems fine in isolation can be effectively slow because the broker hosting it is oversubscribed by other high-volume partitions — a noisy-neighbor problem that requires broker-level metrics (not just partition-level metrics) to diagnose.

The partition count decision, stated as a rule: more partitions increase parallelism (more consumers can read simultaneously) but also increase the coordination overhead in the cluster and the number of file handles brokers must manage. A common production mistake is over-provisioning partition count “for future scale” without understanding that partition count can be increased later (though not decreased) — starting conservatively and growing is usually safer than over-provisioning upfront, the opposite intuition from Kinesis shard planning where under-provisioning causes immediate throttling.


Consumer Groups: How Kafka’s Delivery Model Actually Works

This is the mechanism worth understanding precisely, because it’s structurally different from Kinesis’s per-shard consumer model in ways that affect application design.

Kafka consumer group mechanics:
A topic has N partitions
A consumer group has M consumer instances
Kafka assigns partitions to consumers WITHIN the
group such that each partition is read by exactly
ONE consumer in that group at a time
If M <= N: partitions are distributed across
consumers (some consumers may get
multiple partitions)
If M > N: excess consumers sit IDLE - a partition
can only be assigned to one consumer,
so having more consumers than partitions
wastes resources
Rebalancing: when a consumer joins or leaves the
group (crash, deploy, scale event),
Kafka triggers a rebalance - partition
assignments are recalculated across
the remaining/new consumer set
During rebalancing: consumption pauses briefly
for affected partitions -
this is the exact mechanism
behind the opening scenario's
maintenance-window lag spikes,
since broker maintenance can
trigger consumer rebalancing

Why the opening scenario happened specifically: MSK’s maintenance operations (patching a broker) can cause temporary broker unavailability, which triggers consumer group rebalancing as Kafka’s coordination layer detects the change and reassigns partitions. This rebalancing pause is normal, expected Kafka behavior — but it was unfamiliar to a team whose self-managed cluster had never undergone maintenance on an AWS-controlled schedule, so the lag spike was diagnosed as a mystery rather than recognized immediately as routine rebalancing.

Multiple consumer groups reading the same topic: unlike the shared-throughput model in Kinesis (before Enhanced Fan-Out), Kafka’s consumer group model means different consumer groups reading the same topic are entirely independent — each group gets its own complete view of the topic’s data, with its own offset tracking, at no additional throughput cost. This is a genuine architectural advantage over base Kinesis for multi-consumer patterns.


MSK Connect: The Kafka Connect Ecosystem

Kafka Connect is one of Kafka’s most valuable ecosystem components, and MSK Connect brings it to the managed service without requiring you to run Connect workers yourself.

What Kafka Connect does:
Provides pre-built connectors for moving data
INTO Kafka (source connectors) or OUT of Kafka
(sink connectors) without writing custom
producer/consumer code
Common data engineering source connectors:
Debezium (CDC from PostgreSQL, MySQL, etc.)
JDBC source connector (periodic polling of a
database table)
Common data engineering sink connectors:
S3 sink connector (writes Kafka topic data to
S3, with configurable partitioning and file
format - directly relevant to Blog 2's
principles)
Redshift/JDBC sink connector

Why this matters specifically for CDC (Change Data Capture) pipelines: Debezium’s CDC connector reads a database’s transaction log directly (not polling the table), capturing every insert, update, and delete as it happens — the same fundamental CDC concept covered in the Databricks series’ Lakeflow Connect article, implemented here through the Kafka Connect ecosystem instead of a Databricks-native connector. This is one of the strongest reasons to choose MSK over Kinesis for database-sourced pipelines: Kinesis has no equivalent to Debezium’s mature, widely-adopted CDC connector ecosystem.

MSK Connect configuration considerations:
Worker capacity (MCU - MSK Connect Unit - similar
concept to Glue's DPU, Blog 5) must be sized to
the connector's throughput needs
Connector configuration (specific to each connector
type) determines behavior - e.g., the S3 sink
connector's flush size and rotation interval is
the same file-count-vs-latency trade-off as
Firehose's buffer configuration (Blog 8)

Security and Networking: Building Directly on Blogs 3 and 4

MSK clusters run inside your VPC, the same way EMR does (Blog 4’s comparison) — a meaningfully different networking model than the AWS-managed infrastructure Kinesis and Glue default to.

MSK networking requirements:
Cluster deployed into subnets you specify
(typically private subnets, per Blog 4's
principles)
Security groups controlling which resources
can reach the broker ports (9092/9094/9098
depending on the auth mechanism)
Producers and consumers need network line-of-sight
to the brokers - if they're outside the VPC,
this requires the same VPC Peering, Transit
Gateway, or VPN patterns covered in Blog 4
MSK authentication options:
IAM authentication (uses the same IAM role/policy
model from Blog 3 - the most AWS-native option)
SASL/SCRAM (username/password style, portable
to non-AWS Kafka setups)
Mutual TLS (certificate-based, common in
security-strict environments)
Unauthenticated (only appropriate within a
fully trusted, isolated VPC - rarely correct
for production)

The specific IAM authentication pattern that connects directly to Blog 3:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kafka-cluster:Connect",
"kafka-cluster:DescribeCluster"
],
"Resource": "arn:aws:kafka:*:*:cluster/my-cluster/*"
},
{
"Effect": "Allow",
"Action": [
"kafka-cluster:ReadData",
"kafka-cluster:DescribeTopic"
],
"Resource": "arn:aws:kafka:*:*:topic/my-cluster/*/events-topic"
}
]
}

This is the same permission evaluation model from Blog 3 — identity-based policy, explicit resource scoping, and the same principle of granting only the specific topics a consumer actually needs rather than cluster-wide access.


MSK Serverless: The Simplified Variant

MSK Serverless removes broker capacity planning entirely, automatically scaling based on throughput — trading some configuration control for operational simplicity, similar to the trade-off pattern from Blog 7’s compute comparison.

MSK Provisioned:
You choose broker instance type and count
You manage storage scaling (or enable auto-scaling)
More configuration control, requires more capacity
planning expertise
Better economics at sustained, high, predictable
throughput
MSK Serverless:
No broker sizing decisions - capacity scales
automatically
Simpler operational model
Pricing based on throughput and storage consumed
Some Kafka features unavailable (check current
MSK Serverless documentation for the specific
feature gap, as this evolves)
Better economics for variable or unpredictable
throughput patterns, similar to Redshift
Serverless's trade-off in Blog 6

MSK vs Kinesis: The Complete Decision

Building on Blog 8’s preview, here’s the full comparison once MSK’s specifics are understood.

Factor                    MSK                  Kinesis
─────────────────────────────────────────────────────────────
Existing Kafka investment Migrate with no Requires rewriting
code changes producer/consumer
CDC connector ecosystem Debezium, mature No direct
and widely adopted equivalent
Networking model Runs in YOUR VPC AWS-managed,
(Blog 4 concepts simpler default
apply directly) networking
Consumer group model True independent Shared throughput
per-group consumption per shard (unless
using EFO)
Operational complexity Higher - partition, Lower - shard
broker, and consumer management is
group tuning needed more constrained
but simpler
AWS-native integration Good, via IAM auth Deeper - tighter
and standard AWS CloudWatch,
networking Firehose integration
Team expertise required Kafka operational AWS service
knowledge genuinely knowledge,
helps less Kafka-specific
expertise needed

The decision, stated simply: if you’re migrating existing Kafka workloads, or specifically need Debezium-style CDC or the Kafka Connect ecosystem, MSK is the clear choice regardless of team size. If you’re building a new pipeline with no Kafka legacy and no specific need for Kafka’s ecosystem, Kinesis’s simpler operational model and deeper native AWS integration usually wins — unless your team already has deep Kafka expertise, in which case the operational complexity difference matters less.


Architecture Flow: A Complete MSK Pipeline

Source database (PostgreSQL, MySQL)
|
| Debezium CDC connector reads transaction log
v
+-------------------------------------------------+
| MSK Cluster (in your VPC) |
| |
| Topics: one per source table, partitioned |
| by primary key for ordering |
| |
| Consumer Group A: real-time alerting |
| Consumer Group B: S3 archival (independent, |
| full throughput, no |
| contention with Group A) |
+----------+-----------------------+--------------+
| |
v v
Lambda (alerts) MSK Connect S3 sink
(Blog 2's partitioning
and format principles
apply to the connector'
s
output configuration)
|
v
S3 Bronze layer

Failure Modes You’ll See in Production

Maintenance window triggering unexpected consumer rebalancing. The opening scenario. MSK’s default or misconfigured maintenance window falls during business hours, or the team never explicitly reviewed it after migrating from self-managed Kafka. Broker maintenance triggers consumer group rebalancing, causing a temporary lag spike that looks like an application problem but is routine Kafka coordination behavior.

Partition count under-provisioned, limiting consumer parallelism. A topic is created with 3 partitions “to start simple.” Six months later, the team wants to scale to 10 consumer instances for higher throughput — but with only 3 partitions, 7 of those 10 consumers sit permanently idle, because Kafka can’t assign more than one consumer per partition within a group. Increasing partition count is possible but requires understanding the ordering implications for any keys already in flight.

Broker-level resource contention masked by partition-level metrics looking fine. A specific partition’s consumer lag increases, and the team investigates that partition specifically, finding nothing wrong with it in isolation. The actual cause is a different, unrelated high-volume partition sharing the same broker, consuming disk I/O and CPU that starves every other partition on that broker — invisible without broker-level (not just partition-level) monitoring.

MSK Connect S3 sink connector configured with a tiny flush interval. Following the same pattern as Blog 8’s Firehose failure mode, an S3 sink connector configured for near-immediate flushing creates the small-file problem from Blog 2, this time originating from the Connect layer instead of Firehose or a Glue job.

IAM authentication configured but security groups still too permissive. A team enables IAM authentication for MSK (correctly restricting who can authenticate) but leaves the cluster’s security group open to the entire VPC CIDR range, rather than scoping it to the specific security groups of producer and consumer applications (Blog 4’s security group best practice). IAM authentication provides identity verification, but network-level access control is a separate, equally necessary layer.

Migrating to MSK Serverless without checking feature compatibility. A team migrates a provisioned MSK cluster to Serverless for operational simplicity, without first verifying that every Kafka feature their applications depend on (specific configuration options, certain client library behaviors) is supported in the Serverless variant — discovering a gap only after the migration is underway.


Trade-offs: What MSK Optimizes For

MSK optimizes for:

  • Genuine Kafka compatibility — existing producer/consumer code, client libraries, and operational knowledge transfer directly
  • Access to the mature Kafka Connect ecosystem, particularly CDC connectors like Debezium
  • Independent multi-consumer-group throughput, without the shared-capacity constraints of base Kinesis
  • Teams with existing Kafka operational expertise who want to stop managing broker infrastructure specifically

MSK doesn’t optimize for:

  • Operational simplicity for teams with no Kafka background — the concepts (partitions, consumer groups, rebalancing) require genuine learning investment
  • Zero-configuration networking — MSK’s in-VPC model requires the same deliberate subnet, security group, and connectivity planning as EMR (Blog 4/5)
  • Predictable behavior during managed maintenance unless maintenance windows are deliberately configured and understood
  • The tightest possible native integration with Firehose-style simple delivery patterns — that remains Kinesis’s specific strength

The honest trade-off: MSK gives you real Kafka with less infrastructure burden, at the cost of still needing genuine Kafka operational understanding — the “managed” part removes broker patching and provisioning, not the conceptual complexity of partitions, consumer groups, and the ecosystem built around them.


Real-World Constraints

MSK cluster resizing (broker count or instance type changes) is not instantaneous. Similar to Redshift’s cluster resize constraint (Blog 6), scaling an MSK cluster’s broker count or type takes time and should be planned ahead of anticipated load changes rather than treated as an instant reactive lever.

Cross-cluster replication (MirrorMaker 2) adds significant operational complexity. Multi-region or multi-cluster MSK architectures using MirrorMaker 2 for replication introduce their own failure modes (replication lag, topic configuration drift between clusters) that are beyond this article’s scope but worth flagging before assuming multi-cluster MSK is a simple extension of single-cluster operation.

MSK Connect worker autoscaling has its own tuning surface. Similar to Glue’s DPU sizing (Blog 5) or Kinesis’s shard capacity (Blog 8), MSK Connect’s worker capacity (measured in MCUs) needs to be sized to the connector’s actual throughput — under-provisioning causes connector lag with the same silent-degradation pattern seen throughout this series’ streaming and compute articles.


What This Means for the Rest of the Series

Blog 15 (Real-time pipeline architecture): where MSK
or Kinesis
(whichever
fits the
scenario) gets
assembled into
a complete
end-to-end
architecture
Blog 18 (Cost optimization): MSK broker sizing and
MSK Serverless vs
provisioned decisions
are covered as part of
the broader cost audit,
alongside Kinesis shard
sizing from Blog 8

Summary: The Engineering Lesson

MSK’s core promise — real Kafka, managed infrastructure — is genuine and valuable for the right team. The gap between that promise and smooth production operation is the same gap that appears throughout this series with every managed service: “managed” shifts what you’re responsible for, it doesn’t eliminate the responsibility.

The three-week maintenance-window debugging session from the opening scenario wasn’t caused by MSK being unreliable. It was caused by an assumption — that migrating to managed infrastructure meant no longer needing to think about broker-level operational events — that doesn’t hold for MSK any more than it holds for RDS, EMR, or any other AWS service where “managed” means “AWS handles the mechanics, you still own the architecture decisions.”

Kafka’s conceptual model — partitions, consumer groups, rebalancing — doesn’t disappear when AWS manages the brokers. It’s the same model, with different infrastructure underneath, and the teams who succeed with MSK are the ones who understand that distinction going in.


Next in Series

Blog 10 - AWS Lambda for Data Engineering: Event-Driven ETL Patterns

Blogs 5 through 9 covered the heavy compute and streaming services. Blog 10 covers the lightweight glue that connects them — Lambda functions triggered by S3 events, Kinesis records, or scheduled intervals, orchestrating the handoff between services rather than doing the heavy transformation work itself.

We’ll go deep on exactly where Lambda’s constraints (timeout, memory, cold starts) mean it’s the wrong tool for ETL but the right tool for triggering ETL — and the specific event-driven patterns that make Lambda genuinely valuable in a data pipeline architecture.


Comment Below

What’s the most unexpected “managed service still requires operational awareness” lesson you’ve learned — with MSK or any other AWS managed service?

Was it a maintenance window triggering consumer rebalancing you didn’t expect? A partition count decision made early that limited scaling options months later? A broker-level resource contention problem that stayed hidden because you were only watching partition-level metrics?

And — did the “managed” framing of the service delay you from looking in the right place when something went wrong?


Tags: aws-data-engineering, amazon-msk, apache-kafka, kafka-connect, debezium, cdc, streaming, consumer-groups, dataforge