SlideShare a Scribd company logo
13
Most read
14
Most read
22
Most read
Running Kafka as
a Native Binary using GraalVM
Ozan Gunalp, Red Hat
Ozan Gunalp, Red Hat – Quarkus
@ozangunalp
Running Kafka as a
Native Binary using GraalVM
The Problem
Kafka is fast!
3
Can we make it faster?
Reducing broker startup time as much as possible
sub second startup time
Integration Tests with Kafka
KafkaContainer
- Confluent platform image, provided by
org.testcontainers:kafka
- Zookeeper & Kraft-mode
- Not compatible with random
bootstrap.servers port
StrimziKafkaContainer
- Strimzi image, provided by
io.strimzi:strimzi-test-container
- Zookeeper & Kraft-mode
- Can be used with random port
- Cluster support
- Toxiproxy support to simulate network
conditions
4
Both are slow to startup
Kraft with format-storage uses another Java process to create log-dir
Quarkus Dev Services
5
Quarkus
6
Frictionless development
Optimized for Distributed Architectures
Quarkus Developer Joy
7
Dev Mode with live reload, Dev services and Continuous testing
Unified Configuration
Customizable defaults
Quarkus Kube-Native
8
Low memory overhead + Fast startup time + Small container size
=
Increase the deployment density
Observability & Resilience
❤
Quarkus Build-Time
9
kafka-native
10
Kafka broker embedded in a Quarkus application
Default configuration for dev/test purposes
Completely configurable
Compiled to native binary using GraalVM
GraalVM Native Image
Run the same workload on smaller machines on the cloud
11
🚀 🔐 🗜
Smaller size images
– no JVM included
Minimal attack
surface
🍃
Smaller memory
footprint
Faster startup time
– No warmup
native-image compilation
Reachability analysis
Build-time Class Initialization
Heap snapshotting
Metadata for Runtime Reflection, Security Providers 12
Compiling Kafka to native
Netty GraalVM support inherited from Quarkus
Security Providers
Plain, Scram, OAuth, GSSAPI
Substitutions
No Random init on static fields, No thread initialization
Bytecode manipulation
No JMX Support – YammerMetrics, MBean
13
kafka-native Quarkus Dev Service
14
Startup time RSS at startup
quay.io/strimzi-test-container/test-
container
@0.103.0-kafka-3.3.2
~3s 370Mb
vectorized/redpanda
@v22.3.4
~200ms 135Mb
quay.io/ogunalp/kafka-native
@0.2.0-kafka-3.4.0
~120ms 45Mb
quarkus.kafka.devservice.provider=kafka-native
kafka-native-test-container
<!-- https://mvnrepository.com/artifact/com.ozangunalp/kafka-native-test-container -->
<dependency>
<groupId>com.ozangunalp</groupId>
<artifactId>kafka-native-test-container</artifactId>
<version>0.2.0</version>
</dependency>
15
try (var container = new KafkaNativeContainer()) {
container.start();
String bootstrapServers = container.getBootstrapServers();
// create topics
// produce
// consume
}
kafka-native-test-container
16
String clusterId = Uuid.randomUuid().toString();
String quorumVotes = "1@broker1:9094";
var controllerAndBroker = new KafkaNativeContainer();
var brokerOnly = new KafkaNativeContainer();
var common = Map.of(
"SERVER_CLUSTER_ID", clusterId,
"KAFKA_CONTROLLER_QUORUM_VOTERS", quorumVotes);
common.forEach(controllerAndBroker::addEnv);
common.forEach(brokerOnly::addEnv);
controllerAndBroker.withNetworkAliases(broker1);
controllerAndBroker.withNetwork(network);
controllerAndBroker.addEnv("SERVER_HOST", "broker1");
controllerAndBroker.addEnv("KAFKA_BROKER_ID", "1");
brokerOnly.withNetworkAliases(broker2);
brokerOnly.withNetwork(network);
brokerOnly.addEnv("SERVER_HOST", "broker2");
brokerOnly.addEnv("KAFKA_BROKER_ID", "2");
brokerOnly.addEnv("KAFKA_PROCESS_ROLES", "broker");
Startables.deepStart(controllerAndBroker, brokerOnly);
var bs = brokerOnly.getBootstrapServers();
// produce, consume
kafka-native on the Cloud
17
Azure Container Instances
Single-node 1vCPU - 1Gb
~$1.30 per day (us-central)
1rps, 100rps, 1000rps, 5000rps
This is not a benchmark
Caveats
Good for tests and dev
Not production-ready
Classes are linked statically: limited strategy classes
GC performance – only Serial GC in GraalVM CE for now
Lacks managed beans / JMX for observability
Experimental support coming in GraalVM 23
18
What’s Next?
19
Support Zookeeper (Thanks to @kwall)
Support multiple Kafka versions (Thanks to @franvila)
Multi-arch images (ARM support)
Move to Smallrye organization
Experimental JMX Support
https://github.com/ozangunalp/kafka-native
https://quarkus.io
@quarkusio
https://quarkusio.zulipchat.com
https://code.quarkus.io
$>
vs Redpanda
kafka-native IS Kafka upstream code
Redpanda is more than a Kafka-compatible broker
Schema registry, HTTP proxy and UI console
Redpanda behaves slightly differently
Redpanda transactions do not support complete Kafka transactions protocol (?)
21
Strategy config
principal.builder.class, default: DefaultKafkaPrincipalBuilder
replica.selector.class
sasl.client.callback.handler.class
sasl.login.callback.handler.class
sasl.login.class
sasl.server.callback.handler.class
security.providers
ssl.engine.factory.class
alter.config.policy.class.name
authorizer.class.name
client.quota.callback.class
create.cluster.link.policy.class.name
create.topic.policy.class.name
kafka.metrics.reporters
metric.reporters
22

More Related Content

PDF
ksqlDB: A Stream-Relational Database System
PPTX
Deep Dive into Apache Kafka
PDF
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
PDF
Upleveling Analytics with Kafka with Amy Chen
PDF
Exactly-Once, Again: Adding EOS Support for Kafka Connect Source Connectors w...
PDF
Storage Capacity Management on Multi-tenant Kafka Cluster with Nurettin Omeroglu
PDF
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
PDF
A Deep Dive into Kafka Controller
ksqlDB: A Stream-Relational Database System
Deep Dive into Apache Kafka
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Upleveling Analytics with Kafka with Amy Chen
Exactly-Once, Again: Adding EOS Support for Kafka Connect Source Connectors w...
Storage Capacity Management on Multi-tenant Kafka Cluster with Nurettin Omeroglu
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
A Deep Dive into Kafka Controller

What's hot (20)

PPTX
Autoscaling Flink with Reactive Mode
PPTX
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
PDF
Kafka to the Maxka - (Kafka Performance Tuning)
PDF
Kafka Connect and Streams (Concepts, Architecture, Features)
PDF
Spark shuffle introduction
PDF
From Zero to Hero with Kafka Connect
PDF
Top 5 Mistakes When Writing Spark Applications
PDF
Apples and Oranges - Comparing Kafka Streams and Flink with Bill Bejeck
PDF
Kafka Security 101 and Real-World Tips
PDF
アーキテクチャから理解するPostgreSQLのレプリケーション
PPT
Using galera replication to create geo distributed clusters on the wan
PDF
Apache Spark 2.0: A Deep Dive Into Structured Streaming - by Tathagata Das
PDF
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
PDF
Producer Performance Tuning for Apache Kafka
PPTX
Kafka 101
PPTX
Evening out the uneven: dealing with skew in Flink
PDF
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PDF
Parquet performance tuning: the missing guide
PDF
Apache Spark Core – Practical Optimization
PDF
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Autoscaling Flink with Reactive Mode
Kafka Tutorial - Introduction to Apache Kafka (Part 1)
Kafka to the Maxka - (Kafka Performance Tuning)
Kafka Connect and Streams (Concepts, Architecture, Features)
Spark shuffle introduction
From Zero to Hero with Kafka Connect
Top 5 Mistakes When Writing Spark Applications
Apples and Oranges - Comparing Kafka Streams and Flink with Bill Bejeck
Kafka Security 101 and Real-World Tips
アーキテクチャから理解するPostgreSQLのレプリケーション
Using galera replication to create geo distributed clusters on the wan
Apache Spark 2.0: A Deep Dive Into Structured Streaming - by Tathagata Das
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
Producer Performance Tuning for Apache Kafka
Kafka 101
Evening out the uneven: dealing with skew in Flink
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
Parquet performance tuning: the missing guide
Apache Spark Core – Practical Optimization
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Ad

Similar to Running Kafka as a Native Binary Using GraalVM with Ozan Günalp (20)

PPTX
Bring the Action: Using GraalVM in Production
PDF
PDF
Quarkus - a next-generation Kubernetes Native Java framework
PDF
Quarkus on Knative at Red Hat Summit 2019
PDF
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
PPTX
Knative with .NET Core and Quarkus with GraalVM
PPTX
Real-time streaming and data pipelines with Apache Kafka
PPTX
Quarkus and GraalVM
PDF
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
PPTX
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
PDF
Devoxx France 2023 - 1,2,3 Quarkus.pdf
PDF
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
PDF
JCConf.tw 2020 - Building cloud-native applications with Quarkus
PDF
Quarkus Denmark 2019
PDF
Traktor pro Crack 2025 Free Download Advance Form
PDF
Adobe Illustrator 2025 Crack Download free
PDF
USING GRAALVM IN PRODUCTION - JAVAONE.pdf
PDF
PDF Reader Pro Crack FREE Download Latest Version
PDF
Y. Tsesmelis, Uni Systems: Quarkus use cases and business value
PDF
Sergio Seabra - Red Hat - OSL19
Bring the Action: Using GraalVM in Production
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus on Knative at Red Hat Summit 2019
Reactive Amsterdam - Maxim Burgerhout - Quarkus Intro
Knative with .NET Core and Quarkus with GraalVM
Real-time streaming and data pipelines with Apache Kafka
Quarkus and GraalVM
[DevConf.US 2019]Quarkus Brings Serverless to Java Developers
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
Devoxx France 2023 - 1,2,3 Quarkus.pdf
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
JCConf.tw 2020 - Building cloud-native applications with Quarkus
Quarkus Denmark 2019
Traktor pro Crack 2025 Free Download Advance Form
Adobe Illustrator 2025 Crack Download free
USING GRAALVM IN PRODUCTION - JAVAONE.pdf
PDF Reader Pro Crack FREE Download Latest Version
Y. Tsesmelis, Uni Systems: Quarkus use cases and business value
Sergio Seabra - Red Hat - OSL19
Ad

More from HostedbyConfluent (20)

PDF
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
PDF
Renaming a Kafka Topic | Kafka Summit London
PDF
Evolution of NRT Data Ingestion Pipeline at Trendyol
PDF
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
PDF
Exactly-once Stream Processing with Arroyo and Kafka
PDF
Fish Plays Pokemon | Kafka Summit London
PDF
Tiered Storage 101 | Kafla Summit London
PDF
Building a Self-Service Stream Processing Portal: How And Why
PDF
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
PDF
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
PDF
Navigating Private Network Connectivity Options for Kafka Clusters
PDF
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
PDF
Explaining How Real-Time GenAI Works in a Noisy Pub
PDF
TL;DR Kafka Metrics | Kafka Summit London
PDF
A Window Into Your Kafka Streams Tasks | KSL
PDF
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
PDF
Data Contracts Management: Schema Registry and Beyond
PDF
Code-First Approach: Crafting Efficient Flink Apps
PDF
Debezium vs. the World: An Overview of the CDC Ecosystem
PDF
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Renaming a Kafka Topic | Kafka Summit London
Evolution of NRT Data Ingestion Pipeline at Trendyol
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Exactly-once Stream Processing with Arroyo and Kafka
Fish Plays Pokemon | Kafka Summit London
Tiered Storage 101 | Kafla Summit London
Building a Self-Service Stream Processing Portal: How And Why
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Navigating Private Network Connectivity Options for Kafka Clusters
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Explaining How Real-Time GenAI Works in a Noisy Pub
TL;DR Kafka Metrics | Kafka Summit London
A Window Into Your Kafka Streams Tasks | KSL
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Data Contracts Management: Schema Registry and Beyond
Code-First Approach: Crafting Efficient Flink Apps
Debezium vs. the World: An Overview of the CDC Ecosystem
Beyond Tiered Storage: Serverless Kafka with No Local Disks

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
GamePlan Trading System Review: Professional Trader's Honest Take
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
NewMind AI Monthly Chronicles - July 2025
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf

Running Kafka as a Native Binary Using GraalVM with Ozan Günalp

  • 1. Running Kafka as a Native Binary using GraalVM Ozan Gunalp, Red Hat
  • 2. Ozan Gunalp, Red Hat – Quarkus @ozangunalp Running Kafka as a Native Binary using GraalVM
  • 3. The Problem Kafka is fast! 3 Can we make it faster? Reducing broker startup time as much as possible sub second startup time
  • 4. Integration Tests with Kafka KafkaContainer - Confluent platform image, provided by org.testcontainers:kafka - Zookeeper & Kraft-mode - Not compatible with random bootstrap.servers port StrimziKafkaContainer - Strimzi image, provided by io.strimzi:strimzi-test-container - Zookeeper & Kraft-mode - Can be used with random port - Cluster support - Toxiproxy support to simulate network conditions 4 Both are slow to startup Kraft with format-storage uses another Java process to create log-dir
  • 7. Quarkus Developer Joy 7 Dev Mode with live reload, Dev services and Continuous testing Unified Configuration Customizable defaults
  • 8. Quarkus Kube-Native 8 Low memory overhead + Fast startup time + Small container size = Increase the deployment density Observability & Resilience ❤
  • 10. kafka-native 10 Kafka broker embedded in a Quarkus application Default configuration for dev/test purposes Completely configurable Compiled to native binary using GraalVM
  • 11. GraalVM Native Image Run the same workload on smaller machines on the cloud 11 🚀 🔐 🗜 Smaller size images – no JVM included Minimal attack surface 🍃 Smaller memory footprint Faster startup time – No warmup
  • 12. native-image compilation Reachability analysis Build-time Class Initialization Heap snapshotting Metadata for Runtime Reflection, Security Providers 12
  • 13. Compiling Kafka to native Netty GraalVM support inherited from Quarkus Security Providers Plain, Scram, OAuth, GSSAPI Substitutions No Random init on static fields, No thread initialization Bytecode manipulation No JMX Support – YammerMetrics, MBean 13
  • 14. kafka-native Quarkus Dev Service 14 Startup time RSS at startup quay.io/strimzi-test-container/test- container @0.103.0-kafka-3.3.2 ~3s 370Mb vectorized/redpanda @v22.3.4 ~200ms 135Mb quay.io/ogunalp/kafka-native @0.2.0-kafka-3.4.0 ~120ms 45Mb quarkus.kafka.devservice.provider=kafka-native
  • 16. kafka-native-test-container 16 String clusterId = Uuid.randomUuid().toString(); String quorumVotes = "1@broker1:9094"; var controllerAndBroker = new KafkaNativeContainer(); var brokerOnly = new KafkaNativeContainer(); var common = Map.of( "SERVER_CLUSTER_ID", clusterId, "KAFKA_CONTROLLER_QUORUM_VOTERS", quorumVotes); common.forEach(controllerAndBroker::addEnv); common.forEach(brokerOnly::addEnv); controllerAndBroker.withNetworkAliases(broker1); controllerAndBroker.withNetwork(network); controllerAndBroker.addEnv("SERVER_HOST", "broker1"); controllerAndBroker.addEnv("KAFKA_BROKER_ID", "1"); brokerOnly.withNetworkAliases(broker2); brokerOnly.withNetwork(network); brokerOnly.addEnv("SERVER_HOST", "broker2"); brokerOnly.addEnv("KAFKA_BROKER_ID", "2"); brokerOnly.addEnv("KAFKA_PROCESS_ROLES", "broker"); Startables.deepStart(controllerAndBroker, brokerOnly); var bs = brokerOnly.getBootstrapServers(); // produce, consume
  • 17. kafka-native on the Cloud 17 Azure Container Instances Single-node 1vCPU - 1Gb ~$1.30 per day (us-central) 1rps, 100rps, 1000rps, 5000rps This is not a benchmark
  • 18. Caveats Good for tests and dev Not production-ready Classes are linked statically: limited strategy classes GC performance – only Serial GC in GraalVM CE for now Lacks managed beans / JMX for observability Experimental support coming in GraalVM 23 18
  • 19. What’s Next? 19 Support Zookeeper (Thanks to @kwall) Support multiple Kafka versions (Thanks to @franvila) Multi-arch images (ARM support) Move to Smallrye organization Experimental JMX Support https://github.com/ozangunalp/kafka-native
  • 21. vs Redpanda kafka-native IS Kafka upstream code Redpanda is more than a Kafka-compatible broker Schema registry, HTTP proxy and UI console Redpanda behaves slightly differently Redpanda transactions do not support complete Kafka transactions protocol (?) 21
  • 22. Strategy config principal.builder.class, default: DefaultKafkaPrincipalBuilder replica.selector.class sasl.client.callback.handler.class sasl.login.callback.handler.class sasl.login.class sasl.server.callback.handler.class security.providers ssl.engine.factory.class alter.config.policy.class.name authorizer.class.name client.quota.callback.class create.cluster.link.policy.class.name create.topic.policy.class.name kafka.metrics.reporters metric.reporters 22