Zum Inhalt springen
_CORE
KI & Agentensysteme Unternehmensinformationssysteme Cloud & Platform Engineering Datenplattform & Integration Sicherheit & Compliance QA, Testing & Observability IoT, Automatisierung & Robotik Mobile & Digitale Produkte Banken & Finanzen Versicherungen Öffentliche Verwaltung Verteidigung & Sicherheit Gesundheitswesen Energie & Versorgung Telko & Medien Industrie & Fertigung Logistik & E-Commerce Retail & Treueprogramme
Referenzen Technologien Blog Know-how Tools
Über uns Zusammenarbeit Karriere
CS EN DE
Lassen Sie uns sprechen

Apache Kafka — distribuovaná streamovací platforma

09. 03. 2023 1 Min. Lesezeit intermediate

Apache Kafka is the standard for event streaming. Millions of messages per second, guaranteed delivery, and unlimited scalability.

Architektur und Konzepte

Kafka is a distributed commit log — it persistently stores messages and allows repeated reads.

Konzepte

  • Topic — logical channel
  • Partition — physical division for parallelism
  • Consumer Group — automatic partition assignment
  • Broker — server in the cluster
from confluent_kafka import Producer, Consumer
import json

producer = Producer({'bootstrap.servers': 'kafka:9092'})
producer.produce('orders', key=b'123', value=json.dumps(order).encode())
producer.flush()

consumer = Consumer({
    'bootstrap.servers': 'kafka:9092',
    'group.id': 'processor',
    'auto.offset.reset': 'earliest',
})
consumer.subscribe(['orders'])
while True:
    msg = consumer.poll(1.0)
    if msg: process(json.loads(msg.value()))

Bewaehrte Praktiken

  • Replication factor 3
  • Idempotent producer
  • Schema Registry — schema versioning

Zusammenfassung

Kafka is the foundation of event-driven architecture. Topics, partitions, and consumer groups for scalable real-time pipelines.

apache kafkastreamingevent-drivenmessaging
Teilen:

CORE SYSTEMS Team

Wir bauen Kernsysteme und KI-Agenten, die den Betrieb am Laufen halten. 15 Jahre Erfahrung mit Enterprise-IT.