Logo vun Backend Data Streaming

Backend Data Streaming

Communautéit
j4flmao
backend-data-streaming

Use this skill when the user says 'data streaming', 'kafka architecture', 'stream processing', 'flink job', 'kafka streams', 'exactly once', 'watermarks', 'windowed aggregation', 'consumer lag', 'log compaction'. Designs backend streaming pipelines on Kafka (or compatible logs) with Flink or Kafka Streams: partitioning, consumer groups, offset/commit strategy, stateful processing, event time and watermarks, and exactly-once configuration. Do NOT use for: simple pub/sub between services (backend-event-driven-architecture), broker selection for task queues (backend-message-queue), analytics warehouse/lakehouse pipelines (data-streaming in skills/data).

Iwwersiicht

Editeurj4flmao
Repositoryagent-skills
Skill-Nummbackend-data-streaming
Stären
41
Forks
6
Matgeliwwert Fichieren
7
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum j4flmao op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Backend Data Streaming an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/backend/universal/data-streaming .claude/skills/backend-data-streaming
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Backend Data Streaming an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Backend Data Streaming automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Backend Data Streaming net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Data Streaming Architecture

Purpose

Build pipelines that process continuous event streams with predictable latency and correct results under failures, late data and redelivery. Covers Kafka topic design, consumer scaling, processing semantics, and stateful stream processing with Flink or Kafka Streams.

Agent Protocol

Trigger

Exact user phrases: "data streaming", "kafka architecture", "stream processing", "flink job", "kafka streams", "exactly once", "watermarks", "windowed aggregation", "consumer lag", "log compaction".

Input Context

  • Event sources, volume (events/s, bytes/s), and latency target.
  • Ordering and correctness needs (approximate OK vs exact counts, money).
  • Processing engine in use or allowed (Flink, Kafka Streams, Spark Structured Streaming, plain consumers).
  • Sinks (DB, search index, another topic, warehouse).

Output Artifact

Pipeline diagram, topic/partition plan, producer/consumer/processor config, and processing code. No files unless requested.

Response Format

Pipeline: {source} -> {topic(partitions, RF)} -> {processor} -> {sink}
Key: {partition key}   Ordering: per key
Semantics: {at-least-once + idempotent sink | exactly-once (transactions)}
Time: {event time, watermark = max_ts - {lateness}} Window: {tumbling/sliding/session, size}
State: {store/backend, TTL}   Checkpoint: {interval}

Kafka Fundamentals That Drive Design

ConceptRule
PartitionUnit of ordering and parallelism. Order is only guaranteed within a partition
KeySame key -> same partition (default hash partitioner), so key by the entity whose order matters
Consumer groupEach partition is consumed by at most one member of a group; members beyond the partition count sit idle
Partition countCan be increased but not decreased; increasing remaps keys, breaking per-key order for in-flight data. Size for future peak
RetentionTime/size-based delete, or cleanup.policy=compact to keep the latest value per key (changelogs, state rebuild). Tombstone = null value deletes a key
Replicationreplication.factor=3 with min.insync.replicas=2 and producer acks=all survives one broker loss without data loss
MetadataKafka 4.x runs only in KRaft mode; ZooKeeper is gone

Offset Commit Strategy

StrategyConfigResult
Auto commitenable.auto.commit=true (periodic, auto.commit.interval.ms)Commits on a timer regardless of processing: crash can lose (committed but unprocessed) or duplicate messages
Commit after processingauto commit off, commit after handler succeedsAt-least-once: duplicates on crash/rebalance, no loss
Transactional read-process-writeKafka transactions, consumer isolation.level=read_committedExactly-once for Kafka-to-Kafka
Store offsets with resultsSave offset in the sink DB in the same transaction; seek on startupExactly-once into that DB

Default recommendation: at-least-once plus an idempotent sink (upsert by key, dedupe table on event ID). Reach for transactions only for Kafka-to-Kafka processing where duplicates matter.

Exactly-Once Configuration

Producer side (transactional):

properties
enable.idempotence=true
acks=all
transactional.id=orders-enricher-0   # stable per producer instance

Consumer side:

properties
isolation.level=read_committed
enable.auto.commit=false

Kafka Streams: processing.guarantee=exactly_once_v2 (requires brokers 2.5+). Flink: checkpointing enabled plus KafkaSink with DeliveryGuarantee.EXACTLY_ONCE and a transactionalIdPrefix; downstream consumers must read with read_committed, and output becomes visible only when a checkpoint completes (latency is at least the checkpoint interval).

Exactly-once never extends to external side effects (emails, HTTP calls) automatically; those need idempotency keys.

Event Time, Watermarks and Windows

  • Event time = when it happened (timestamp in the event); processing time = when the operator sees it. Use event time for correctness under replay and lag.
  • A watermark asserts "no more events with timestamp < T are expected". Bounded-out-of-orderness watermark: max_seen_ts - allowed_lateness.
  • Windows fire when the watermark passes the window end. Late events beyond allowed lateness are dropped or sent to a side output.
  • Idle partitions hold back watermarks; configure idleness (WatermarkStrategy.withIdleness) in Flink.
java
// Flink DataStream API: 1-minute tumbling revenue per merchant, event time.
WatermarkStrategy<Order> wm = WatermarkStrategy
    .<Order>forBoundedOutOfOrderness(Duration.ofSeconds(30))
    .withTimestampAssigner((order, ts) -> order.occurredAtMillis())
    .withIdleness(Duration.ofMinutes(1));

DataStream<Order> orders = env.fromSource(kafkaSource, wm, "orders");

orders
    .keyBy(Order::merchantId)
    .window(TumblingEventTimeWindows.of(Duration.ofMinutes(1)))
    .allowedLateness(Duration.ofMinutes(5))
    .sideOutputLateData(lateTag)
    .aggregate(new SumRevenue())
    .sinkTo(revenueSink);

Stateful Processing

EngineState storeFault toleranceFits when
Kafka StreamsLocal RocksDB per task, backed by compacted changelog topicsChangelog restore; standby replicas speed recoveryKafka-in/Kafka-out logic embedded in a JVM service
FlinkHeap or RocksDB state backendPeriodic checkpoints / savepoints to object storageComplex event-time logic, large state, multiple sources/sinks
Spark Structured StreamingState store in executors, checkpoint to storageMicro-batch checkpointsTeams already on Spark; seconds-level latency acceptable

Rules:

  • Set state TTL for keyed state that would otherwise grow forever (e.g. per-user sessions).
  • Joins between two streams need a time bound (interval join) or state grows without limit.
  • Take a savepoint before changing job topology; assign stable operator UIDs in Flink so state maps across versions.

Throughput vs Latency Knobs

SettingHigher value gives
linger.msBigger batches, better throughput, more latency
batch.sizeLarger batches per partition
compression.type (lz4, zstd)Less network/disk, some CPU
fetch.min.bytes / fetch.max.wait.msFewer, larger fetches
max.poll.recordsMore records per poll; keep processing time under max.poll.interval.ms
Checkpoint interval (Flink)Less overhead, longer replay on failure and higher EOS output latency

Operations

  • Monitor consumer lag per partition (records and time), not only total.
  • Alert on under-replicated partitions, ISR shrink, and rebalance frequency.
  • Use cooperative rebalancing (partition.assignment.strategy=CooperativeStickyAssignor) or the new consumer group protocol (group.protocol=consumer, KIP-848) to avoid stop-the-world rebalances.
  • Schema registry with BACKWARD compatibility for every topic.

Anti-Patterns

Anti-patternFix
Processing time windows for business metricsEvent time + watermarks
Unkeyed messages where order mattersKey by entity ID
One partition "to keep order" for the whole topicOrder per key; partition for parallelism
Long blocking calls in poll loop -> rebalancesAsync with bounded in-flight, or raise max.poll.interval.ms deliberately
Unbounded state in joinsInterval joins, TTL
Claiming exactly-once with a non-transactional sinkIdempotent upserts or two-phase commit sink

Checklist

  • Partition key and count sized for peak and ordering.
  • RF=3, min.insync.replicas=2, acks=all for critical topics.
  • Commit strategy and sink idempotency documented.
  • Event-time watermarks, allowed lateness and late-data handling defined.
  • State TTL and checkpoint/savepoint procedure in place.
  • Lag, throughput and DLQ/late-data metrics alerting.

References

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Backend Data Streaming?

Use this skill when the user says 'data streaming', 'kafka architecture', 'stream processing', 'flink job', 'kafka streams', 'exactly once', 'watermarks', 'windowed aggregation', 'consumer lag', 'log compaction'. Designs backend streaming pipelines on Kafka (or compatible logs) with Flink or Kafka Streams: partitioning, consumer groups, offset/commit strategy, stateful processing, event time and watermarks, and exactly-once configuration. Do NOT use for: simple pub/sub between services (backend-event-driven-architecture), broker selection for task queues (backend-message-queue), analytics w...

Firwat Backend Data Streaming op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Backend Data Streaming besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Backend Data Streaming an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Backend Data Streaming benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Backend Data Streaming benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Backend Data Streaming domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Backend Data Streaming gratis?

Jo. De Skill gëtt vum j4flmao ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇