Kafka Deep Dive
kafka-deep
Kafka deep-dive: topic design (partitions, replication factor), KafkaJS producer with idempotent writes, consumer groups with partition assignment, consumer lag monitoring, exactly-once semantics, schema registry, compacted topics, DLQ patterns. Use when designing Kafka topics, implementing produ...
SKILL.md
Full skill instructions
Kafka Deep Dive
When to Use This Skill
- Designing topic structure (partitions, replication)
- Implementing reliable producers with idempotent writes
- Building consumer groups with proper error handling
- Monitoring consumer lag
- Choosing between Kafka, RabbitMQ, and SQS
Core Principles
- Partition count determines parallelism ceiling — 6 partitions = max 6 consumers in a group; you cannot scale beyond partition count
- Replication factor 3 for production — 1 node lost: still operational; 2 nodes lost: read-only; RF=1 = data loss risk
- Consumer commits must happen after processing — committing before processing = data loss on crash
- At-least-once is the default — design consumers to be idempotent; dedup with Redis
- Consumer lag is the key operational metric — lag >10k messages at current throughput = alert
References available
references/topic-design.md— naming conventions, partition count guidelines, replication factor, retention, partition key strategyreferences/consumer-patterns.md— KafkaJS producer with idempotent writes, consumer group with DLQ, lag monitoring, Kafka vs RabbitMQ vs SQSreferences/exactly-once.md— exactly-once semantics, transactions, schema registry, compacted topics
