Skip to content

gAmUssA/flink-vs-kafka-streams

Repository files navigation

🔄 Flink vs Kafka Streams

📋 Project Overview

This project provides a comparative implementation of stream processing using Apache Flink and Kafka Streams. It demonstrates how to perform similar data processing tasks using both frameworks, allowing developers to understand the differences, strengths, and trade-offs between them.

The project implements a stream processing pipeline that:

  1. 📥 Consumes click events from a Kafka topic

  2. 🔗 Joins these events with category data

  3. ⏱️ Performs windowed aggregation to count unique users per category

  4. 📤 Outputs the results to another Kafka topic

🛠️ Technologies Used

This project uses the following technologies:

  • Java 17 - Programming language

  • 🧩 Kotlin - Used for build configuration

  • 🐘 Gradle - Build tool with Kotlin DSL

  • 📊 Apache Kafka - Distributed streaming platform

  • 🌊 Apache Flink - Stream processing framework

  • 📋 Apache Avro - Data serialization system

  • 🗄️ Confluent Schema Registry - Schema management service

  • 🧪 JUnit 5 - Testing framework

  • 🐳 TestContainers - Integration testing with containerized dependencies

🏗️ Build Instructions

📋 Prerequisites

  • ☕ Java 17 or higher

  • 🐘 Gradle 8.x or higher

  • 🐳 Docker (for integration tests)

🔨 Building the Project

./gradlew build

🧪 Running Tests

To run unit tests:

./gradlew test

To run integration tests:

./gradlew integrationTest

📁 Project Structure

src/
├── main/
│   ├── avro/           # Avro schema definitions
│   ├── java/           # Main source code
│   └── resources/      # Configuration files
├── test/
│   └── java/           # Unit tests
└── integrationTest/
    └── java/           # Integration tests

🔍 Implementation Details

The project contains three main implementations:

  1. 📊 KafkaStreamsProcessor - Implementation using Kafka Streams API

  2. 🌊 FlinkDataStreamProcessor - Implementation using Flink DataStream API

  3. 📋 FlinkTableProcessor - Implementation using Flink Table API

Each implementation provides the same functionality but uses different APIs and approaches.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

a sample application demonstrates Flink and Kafka Streams for stream processing with Apache Kafka®

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •