What Is Event Streaming and Why Does It Matter?
Imagine a busy airport departure board. Hundreds of flights update their status every second — gates change, delays are announced, boarding starts. Every airline app, every terminal screen, and every staff system needs to see these updates in real time. That's event streaming: a continuous flow of data that many systems can read simultaneously, without any single reader blocking another.
Apache Kafka is the industry-standard system for this pattern. It acts as a durable, high-throughput message bus. Producers write events (messages) to named channels called topics. Consumers read from those topics at their own pace. Kafka retains the messages for a configurable period, so a consumer that falls behind can catch up without losing data.
The "Self-Managed" Trap
Running Kafka yourself is operationally expensive. You have to manage:
- Brokers: The EC2 instances (or bare-metal servers) that store and serve data. You provision them, patch them, and replace them when they fail.
- ZooKeeper: A separate distributed coordination cluster that Kafka historically required just to track broker membership and partition leadership. It's a second complex system to secure, patch, and monitor.
- Disk Balance: Kafka stores data in partition logs on local disk. If one broker fills up, you must manually reassign partitions to other brokers — a slow, risky operation that can spike I/O across the cluster.
- Replication Tuning: You must configure replication factors, in-sync replica (ISR) thresholds, and leader election timeouts to balance durability against performance.
Amazon MSK (Managed Streaming for Apache Kafka) removes this operational toil. It is standard, open-source Kafka — the same binary your developers already know — but AWS manages the provisioning, patching, broker replacement, and storage management. You configure the cluster; AWS keeps it running. Your producers and consumers connect to MSK exactly as they would to a self-managed cluster, using the same Kafka client libraries.
Broker Architecture
Under the hood, MSK provisions EC2 instances as Kafka brokers inside your VPC. You choose the instance type (e.g., kafka.m5.large for moderate throughput, kafka.m5.4xlarge for high throughput) and the number of brokers.
- Multi-AZ Deployment: MSK distributes brokers across 2 or 3 Availability Zones. Partition replicas are spread across AZs, so a single AZ outage does not cause data loss or a full cluster outage.
- Automatic Broker Replacement: If a broker's underlying EC2 instance fails, MSK detects it within minutes, provisions a replacement instance, and re-attaches the EBS storage volume. The replacement broker rejoins the cluster and begins catching up on replication automatically. No manual intervention is required.
- Storage: Each broker's data is stored on Amazon EBS volumes. You can choose
gp3(general purpose SSD) for most workloads orio1(provisioned IOPS SSD) for latency-sensitive workloads.
The key operational insight: MSK handles the infrastructure layer. You are still responsible for Kafka-level concerns — topic configuration, replication factors, consumer group management, and schema design.
Interviewers often ask: "What's the difference between Amazon MSK and Amazon Kinesis?" The key distinction is protocol and ecosystem. MSK is standard Kafka — any Kafka client library works without modification, and you can use the full Kafka ecosystem (Kafka Streams, Kafka Connect, MirrorMaker). Kinesis is AWS-proprietary with its own SDK. Choose MSK when you need Kafka compatibility or are migrating an existing Kafka workload. Choose Kinesis when you want a fully serverless, zero-management stream with deep native AWS integration and no Kafka expertise on your team.