Lesson 3 of 4 Amazon Kinesis and Streaming Services

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.

OptionCharacteristics
MSK provisionedYou choose broker types, counts and storage; full control of Kafka configuration
MSK Express brokersHigher throughput per broker and faster scaling, with storage managed by MSK
MSK ServerlessNo capacity to manage; pay for throughput and storage
Match the pairs

MSK deployment options

Exam skills 3.5.2

Match each requirement with the MSK deployment option that meets it.

Log in to try this activity Interactive activities are free with an account.

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.

ChooseWhen
Amazon MSKApplications already use Kafka APIs and tools, or need Kafka features and configuration
Kinesis Data StreamsA simpler, fully AWS-native stream with no Kafka dependency
Scenario questions

MSK or Kinesis?

Exam skills 3.5.2 · 2.1.7

Choose between Amazon MSK and Kinesis Data Streams.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

RequirementChoice
Keep Kafka APIs and client librariesAmazon MSK
Steady, high throughput with tuned configurationMSK provisioned with Express brokers
Copy topics from the old clusterMSK Replicator or MirrorMaker
Land topic data in S3An 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.

Check yourself

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.