Running Apache Kafka with Amazon MSK
This lesson explains how Amazon Managed Streaming for Apache Kafka (Amazon MSK) runs Kafka for applications built on Kafka APIs, without managing brokers yourself.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between MSK provisioned and MSK Serverless.
- Describe MSK features.
- Choose between MSK and Kinesis Data Streams.
Deployment options
Amazon MSK runs Apache Kafka, and it can be deployed with different amounts of management. With MSK provisioned clusters, you choose the broker instance types, the number of brokers and their storage, and have full control of Kafka's configuration, which suits teams that tune Kafka closely. MSK Express brokers give higher throughput per broker and faster scaling, with storage managed by MSK, so there is no disk capacity to plan. MSK Serverless removes capacity management entirely: you pay for the throughput and storage used. The following table summarises the options.
| Option | Characteristics |
|---|---|
| MSK provisioned | You choose broker types, counts and storage; full control of Kafka configuration |
| MSK Express brokers | Higher throughput per broker and faster scaling, with storage managed by MSK |
| MSK Serverless | No capacity to manage; pay for throughput and storage |
MSK deployment options
Features
Amazon Managed Streaming for Apache Kafka (Amazon MSK) runs Apache Kafka clusters as a managed service. Clusters span several Availability Zones, and data is replicated across brokers for durability. Data is encrypted in transit and at rest, and clients authenticate with IAM, TLS certificates or SASL/SCRAM.
MSK Connect runs Kafka Connect connectors that move data between Kafka and other systems, such as Amazon S3 or databases, with no servers to manage. Retention is configurable and can be long, with tiered storage keeping older data at lower cost. Lambda, Firehose and Amazon Managed Service for Apache Flink can all consume MSK topics. MSK is the usual answer when a scenario needs Kafka APIs or is migrating an existing Kafka workload.
MSK or Kinesis Data Streams?
MSK and Kinesis Data Streams both provide durable, ordered streams, so the choice is mainly about the ecosystem. MSK is the answer when applications already use Kafka's APIs, clients and tools, or need Kafka features and configuration, because it runs standard Kafka and existing code works unchanged. Kinesis Data Streams is the answer for a simpler, fully AWS-native stream with no Kafka dependency, integrated with IAM, Lambda and Firehose. The following table summarises the choice.
| Choose | When |
|---|---|
| Amazon MSK | Applications already use Kafka APIs and tools, or need Kafka features and configuration |
| Kinesis Data Streams | A simpler, fully AWS-native stream with no Kafka dependency |
MSK or Kinesis?
Moving a Kafka platform to AWS
A company runs a self-managed Kafka cluster with dozens of producer and consumer applications, and wants to stop managing brokers without rewriting the applications.
| Requirement | Choice |
|---|---|
| Keep Kafka APIs and client libraries | Amazon MSK |
| Steady, high throughput with tuned configuration | MSK provisioned with Express brokers |
| Copy topics from the old cluster | MSK Replicator or MirrorMaker |
| Land topic data in S3 | An MSK Connect S3 sink connector, or Firehose |
Rewriting the applications for Kinesis Data Streams would also work, but costs far more effort than moving to MSK.
What does MSK Serverless remove from running Kafka?
Show answer
Sizing and managing brokers: capacity scales automatically, and clients connect with standard Kafka APIs.
Exam Tips
Remember for the exam
- For existing Kafka producers and consumers, use Amazon MSK.
- To run Kafka without managing capacity, use MSK Serverless.
- To move data between Kafka and other systems without custom code, use MSK Connect.