Apache 2.0. Part of KafScale.

Copy Kafka topics to another cluster, or into S3 through KafScale.

kaf-mirror copies your Kafka topics to any other Kafka cluster, or into S3 through KafScale, with a dashboard, an audit trail and compliance reports.

Backup into KafScale

Replication keeps a hot standby in sync. It also copies deletes, bad writes and anything done with stolen producer credentials. For a backup, mirror into KafScale, a Kafka-compatible broker that stores immutable segments in S3, and keep that copy on separate credentials. The steps are in the README.

What it does

Replication jobs

Built with franz-go. A job consumes from a source Kafka cluster and produces to a target. Same-name mirroring is the default. Exact names and regex mappings are optional. A JobManager starts, stops and pauses jobs. Source offsets are committed only after the target produce is acknowledged.

Web UI

A tab-based dashboard with Operations, Health, Executive and Compliance sections. The UI polls the API every 30 seconds, reads the user's permissions from GET /auth/me, and hides buttons the user cannot use. It fits phone screens down to 390px.

RBAC

Token-based authentication with admin, operator, monitoring and compliance roles. Cluster and config APIs return *** for credentials. A PUT with *** or an empty secret leaves the stored value unchanged.

Metrics and lag

Every running job reports counters every 10 seconds, including messages copied, bytes transferred, errors, tombstones and current lag. Lag is also available at GET /api/v1/jobs/{id}/lag. Job metrics are stored in SQLite. The process /metrics endpoint serves only Go runtime metrics.

AI insights, opt-in

Off until ai.provider is set. Without a provider, kaf-mirror makes no AI requests. When it is on, it can detect anomalies in replication metrics, suggest performance tuning and analyze incidents. See the AI analysis docs.

Compliance reports

Automated daily, weekly and monthly compliance reports with an audit trail. Metrics and operational events are kept for 30 days by default, or a shorter period set with database.retention_days (1 to 30).

TLS and mTLS

TLS is used when security.protocol is SSL or SASL_SSL, and always for the confluent and azure providers. ca_file, cert_file and key_file set a private CA and a client certificate. Each file must be a regular file of at most 1 MiB. Production requires TLS unless server.allow_insecure is set. SASL PLAIN, SCRAM and Kerberos (GSSAPI) are also supported.

Helm

The supported way to run kaf-mirror in Kubernetes is the chart in deploy/helm/kaf-mirror. CI lints and renders it with make helm-check. A default install starts and answers /health.

Also in the current docs

REST API and CLIs

A Fiber REST API manages the application. admin-cli is for bootstrap and emergency maintenance. mirror-cli is the management CLI. The API docs are at /docu/swagger/ when kaf-mirror is running. The CLI reference is on this site.

Configuration

Base configuration comes from a default.yml file. Runtime changes such as jobs, clusters, topic mappings and users are stored in SQLite. Every config key and environment variable is listed in the configuration reference.

Replication halt, experimental

Off until an admin enables it. It freezes all jobs if the source cluster looks compromised, so the replica does not keep copying the attack. See docs/protection.md.

Empty lists

List endpoints answer [] when there is nothing to list, never null. GET /api/v1/jobs/{id}/lag answers {} when there is no lag data.

Where it is used

  • Backup versus replication. Use kaf-mirror between two Kafka clusters for a hot standby, and into KafScale on S3 for a backup that a bad delete does not reach. See Kafka backup vs replication.
  • DORA and NIS2. The audit trail and scheduled compliance reports help show how the copy is run and checked. See the Kafka DORA and NIS2 checklist.
  • Migration and failover drills between Kafka-protocol clusters, with same-name, exact or regex topic mapping.

kaf-mirror is part of Lascaris. Scalytics can run it for you in your own cloud, or support your team running it on-prem or air-gapped.