Kafka Streams: How to use Speedb instead of RocksDB?

By default, Kafka streams uses RocksDB for state store. Speedb is a fully compatible fork of RocksDB that introduces overall performance improvements when used instead. By replacing RocksDB with Speedb you can enjoy the improved performance Speedb offers.
There are 3 options for replacement of RocksDB in Kafka 3.3 and higher:
  1. 1.
    Rebuild Kafka streams with Speedb
  2. 2.
    Replace the RocksDB library with Speedb library
  3. 3.
    Use the prebuilt Kafka+Speedb version

Rebuild Kafka with Speedb

If you are building from source, you need to modify gradle/dependencies.gradle to point to Speedb instead of RocksDB and indicate version instead of 7.1.2:
- rocksDBJni: "org.rocksdb:rocksdbjni:$versions.rocksDB",
+ rocksDBJni: "io.github.speedb-io:speedbjni:$versions.rocksDB",
- rocksDB: "7.1.2",
+ rocksDB: "",

Replace the library

If you are using a prebuilt Kafka version, replace the file libs/rocksdbjni-7.1.2.jar with the jar downloaded from maven at the following URL:
(the downloaded speedbjni file should be renamed to rocksdbjni-7.1.2.jar)

Use the prebuilt Kafka+Speedb version

Click Here to download the latest compiled version.