RSKafka

A minimal, dependency-light Rust client for Apache Kafka, built for using Kafka as a distributed write-ahead log.

Library
Cargo
v0.6.0
336stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity32
Maintenance24
Community72
Maturity56
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture84
Code Quality85
Innovation70
Learning Curve74

RSKafka is a deliberately minimal Rust client for Apache Kafka. Rather than being a general-purpose Kafka implementation, it is heavily optimized for simplicity — both in its implementation and its operational behavior — targeting workloads that use Kafka as a distributed write-ahead log.

It intentionally omits offset tracking, consumer groups, transactions, built-in buffering, aggregation, and linger timeouts, giving you independent write streams per partition and a small, predictable surface. It speaks the Kafka protocol directly over async Tokio, with optional TLS, SASL, and compression support. It was originally used by InfluxDB 3.0.

What You Get

  • A minimal async Kafka client speaking the Kafka wire protocol directly over Tokio
  • Independent per-partition write streams for produce and consume
  • Optional TLS (rustls), SASL (SCRAM/OAuth), and compression (gzip, lz4, snappy, zstd) features
  • A small, predictable API with no consumer groups, transactions, or hidden buffering

Common Use Cases

  • Using Kafka as a distributed write-ahead log with application-managed offsets
  • Lightweight produce/consume in Rust services that don’t need consumer-group semantics
  • Embedding a small-footprint Kafka client where librdkafka’s size or complexity is unwanted

Under The Hood

Architecture — The crate implements the Kafka wire protocol from scratch: protocol/ encodes/decodes Kafka requests and responses, connection.rs/connection/ and messenger.rs manage broker connections and multiplex in-flight requests, and the client/ module exposes the public ClientBuilder, partition clients, and topic operations. Supporting modules handle record encoding, backoff, throttle, and validation. There is deliberately no consumer-group or offset-storage layer.

Tech Stack — Rust on async Tokio, using bytes, crc32c, integer-encoding, parking_lot, and thiserror; optional features pull in rustls/tokio-rustls for TLS, rsasl for SASL, and flate2/lz4/snap/zstd for compression. Dev tests use criterion, proptest, and cross-check against rdkafka.

Code Quality — A focused, well-factored codebase with protocol-level property tests (proptest), benchmarks (criterion), and integration tests that validate behavior against the reference rdkafka client. Maintenance is now infrequent but the surface is small and stable.

API Design — The API is intentionally lean: build a client, get a partition client, and produce/consume records. Because it omits consumer groups and offset management, callers take on that responsibility, which is the main conceptual cost; for its target write-ahead-log use case the surface is minimal and predictable.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search