Backend Data Streaming logo

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

Overview

Publisherj4flmao
Repositoryagent-skills
Skill namebackend-data-streaming
Stars
41
Forks
6
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by j4flmao on GitHub. Read the source before you install it.

Installation

Install the Backend Data Streaming AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Backend Data Streaming in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Backend Data Streaming on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Backend Data Streaming is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Backend Data Streaming AI skill do?

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

Why use Backend Data Streaming on TypingMind?

Because you install it once and use it with any model. Backend Data Streaming is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Backend Data Streaming in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/j4flmao/agent-skills/tree/main/skills/backend/universal/data-streaming. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Backend Data Streaming?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Backend Data Streaming?

As many as you like. As long as a model supports skills, you can use Backend Data Streaming with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Backend Data Streaming AI skill free?

Yes. It is published on GitHub by j4flmao under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇