Logo di Backend Data Streaming

Backend Data Streaming

Community
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).

Panoramica

Autorej4flmao
Repositoryagent-skills
Nome della skillbackend-data-streaming
Stelle
41
Fork
6
File inclusi
7
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 7 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da j4flmao su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Backend Data Streaming in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Backend Data Streaming in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Backend Data Streaming non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Backend Data Streaming non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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...

Perché usare Backend Data Streaming su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Backend Data Streaming è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Backend Data Streaming in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Backend Data Streaming?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Backend Data Streaming?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Backend Data Streaming: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Backend Data Streaming è gratuita?

Sì. È pubblicata su GitHub da j4flmao con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇