Skip to main content

Kafka Topic Config Generator

Configure your Kafka topic and get ready-to-run kafka-topics.sh commands, config properties, and a Terraform resource block — all in one place.

✓ kafka-topics.sh CLI command ✓ Terraform confluent_kafka_topic ✓ Validation warnings ✓ Runs 100% in your browser

Frequently Asked Questions

How many partitions should I use?▼

Partitions determine parallelism. A common rule of thumb: start with max(T/p, T/c) where T is your target throughput, p is the write throughput per partition, and c is the read throughput per partition. For most use cases, 3-12 partitions is a good starting point. More partitions increase parallelism but also increase leader election overhead.

What replication factor should I use?▼

For production, use replication factor 3. This tolerates one broker failure while still maintaining a majority quorum (2 of 3 replicas). Replication factor 1 means no fault tolerance — one broker failure loses data. Replication factor 2 means you lose quorum when one broker fails.

What is min.insync.replicas?▼

min.insync.replicas defines the minimum number of replicas that must acknowledge a write before it's considered successful (when acks=all). Setting it to replication_factor - 1 is common: e.g., for RF=3, set min.insync.replicas=2. If this value equals or exceeds the replication factor, all replicas must be in sync — meaning any single broker failure blocks writes.

What's the difference between delete and compact cleanup policies?▼

cleanup.policy=delete removes messages older than the retention period (time or size based). cleanup.policy=compact retains only the latest message per key — useful for event sourcing and change data capture (CDC). Use compact,delete to apply both: keep only latest keys AND enforce a time-based retention on those records.

Which compression type should I use?▼

snappy offers the best balance of compression ratio and CPU cost for most workloads. lz4 is faster with slightly less compression. zstd provides the best compression ratio but requires Kafka 2.1+. gzip has good compression but higher CPU cost. none is zero overhead but increases network and storage costs significantly for text/JSON payloads.

How do I apply topic-level config changes?▼

Use kafka-configs.sh --alter --add-config: e.g., kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name my-topic --alter --add-config retention.ms=604800000. Topic-level configs override the broker defaults. Use kafka-configs.sh --describe to see current effective config for a topic.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →