Loading...

Build your own Kafka

Learn about TCP servers, the Kafka wire protocol and more.

Start Building
kafka
Kotlin
kafka
Gleam
kafka
Go
kafka
Java
kafka
JavaScript
kafka
Python
kafka
Rust
kafka
TypeScript
kafka
Zig
kafka
C++
kafka
C#
This challenge is free to try when it's in beta. We keep challenges in beta for a few weeks to gather feedback.

Apache Kafka is a distributed event streaming platform often used for high-performance data pipelines. In this challenge, you'll build your own Kafka broker that's capable of serving basic requests.

Along the way you'll learn about TCP servers, the Kafka wire protocol and more.

Base Stages

Apache Kafka is a distributed event streaming platform often used for high-performance data pipelines. In this challenge, you'll build your own Kafka broker that's capable of serving basic requests.

Along the way you'll learn about TCP servers, the Kafka wire protocol and more.

Bind to a port
Easy
We'd expect a proficient developer to take 5-10 minutes to complete this stage.
Send Correlation ID
Easy
We'd expect a proficient developer to take 5-10 minutes to complete this stage.
Parse Correlation ID
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Parse API Version
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Handle ApiVersions requests
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.

Concurrent Clients

In this challenge extension you'll add support for serving multiple clients simultaneously.

Along the way you'll learn about TCP connections, how to handle concurrency and more.

Serial requests
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Concurrent requests
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.

Listing Partitions

In this challenge extension you'll add support for listing topic partitions by implementing the DescribeTopicPartitions API.

Along the way you'll learn about how Kafka stores messages on disk, the __cluster_metadata topic and more.

Include DescribeTopicPartitions in ApiVersions
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
List for an unknown topic
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
List for a single partition
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.
List for multiple partitions
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.
List for multiple topics
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.

Consuming Messages

In this challenge extension you'll add support for consuming messages by implementing the Fetch API.

Along the way you'll learn about how Kafka's Fetch API works, how Kafka stores messages on disk and more.

Include Fetch in ApiVersions
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Fetch with no topics
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Fetch with an unknown topic
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Fetch with an empty topic
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Fetch single message from disk
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.
Fetch multiple messages from disk
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.

Producing Messages

In this challenge extension you'll add support for producing messages by implementing the Produce API.

Along the way you'll learn about how Kafka's Produce API works, how Kafka stores messages on disk and more.

Include Produce in ApiVersions
Easy
We'd expect a proficient developer to take 5-10 minutes to complete this stage.
Respond for invalid topic or partition
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Respond for valid topic and partition
Medium
We'd expect a proficient developer to take 30 minutes to 1 hour to complete this stage.
Produce a single record
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.
Produce multiple records
Hard
We'd expect a proficient developer to take more than 1 hour to complete this stage.
Produce to multiple partitions
Easy
We'd expect a proficient developer to take 5-10 minutes to complete this stage.
Produce to multiple partitions of multiple topics
Easy
We'd expect a proficient developer to take 5-10 minutes to complete this stage.