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. Rebuild Kafka streams with Speedb

  2. Replace the RocksDB library with Speedb library

  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 2.4.1.5 instead of 7.1.2:

- rocksDBJni: "org.rocksdb:rocksdbjni:$versions.rocksDB",

+ rocksDBJni: "io.github.speedb-io:speedbjni:$versions.rocksDB",

- rocksDB: "7.1.2",

+ rocksDB: "2.4.1.5",

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:

https://repo1.maven.org/maven2/io/github/speedb-io/speedbjni/2.4.1.5/

(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.

Last updated